Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for GeoLadder #750

Merged
merged 10 commits into from
Jan 2, 2025
36 changes: 21 additions & 15 deletions Appl/Games/GeoLadder/Main/sndwork.goc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static const SWNoise SW_NOISES[] =
{ IP_SIDE_STICK, MIDDLE_G_SH, DYNAMIC_FFF, 5, 21 }, // Play Der recycle
{ IP_VIBRASLAP, MIDDLE_C, DYNAMIC_FFF, 3, 75 }, // Play Lad hooka
{ IP_ELECTRIC_SNARE, MIDDLE_C, DYNAMIC_FFF, 1, 30 }, // Play Lad dies
{ IP_RIDE_BELL, MIDDLE_C, DYNAMIC_FFF, 2, 57 } // Play Lad new -> XXX: still to be found...
{ IP_SHORT_GUIRO, LOW_E / 4, DYNAMIC_FFF, 2, 42 } // Play Lad new
};


Expand Down Expand Up @@ -310,13 +310,14 @@ static const SWNoise SW_NOISES[] =
{
word e;
word *p_music;
optr musicPart = NullOptr;
Message msg;
// Get the object pointer of the music part to play
// We've locked in MSG_SOUND_WORKER_MUSIC_PLAY() and we'll unlock in MSG_SOUND_WORKER_MUSIC_STOP()
ChunkArrayGetElement(pself->SWI_musicData, pself->SWI_musicPartIndex, &pself->SWI_musicPart);
p_music = LMemDeref(pself->SWI_musicPart);
ChunkArrayGetElement(pself->SWI_musicData, pself->SWI_musicPartIndex, &musicPart);
p_music = LMemDeref(musicPart);
// Patch message and object pointer (handle and chunk) for end of song notification
e = LMemGetChunkSize(pself->SWI_musicPart) / 2;
e = LMemGetChunkSize(musicPart) / 2;
// Get the message to patch
msg = ((pself->SWI_musicPartIndex + 1) < pself->SWI_musicPartCount)
? MSG_SOUND_WORKER_MUSIC_PLAY_EXEC
Expand Down Expand Up @@ -346,7 +347,7 @@ static const SWNoise SW_NOISES[] =
* MSG_SOUND_WORKER_MUSIC_STOP
* for SoundWorkerClass
***********************************************************************
* SYNOPSIS: Stop playing the music and unlock the music part.
* SYNOPSIS: Stop playing the music and unlock the music data.
* CALLED BY: Internal or by patched notification in music data.
* PARAMETERS: void ( void )
* RETURN: nothing
Expand All @@ -355,8 +356,8 @@ static const SWNoise SW_NOISES[] =
* STRATEGY: 1/ Stop playing the music.
* 2/ Free the music handle.
* 3/ Set the instance variable of the music handle to null.
* 4/ Unlock the music part.
* 5/ Set the instance variable of the music part to null.
* 4/ Unlock the music data.
* 5/ Set the instance variable of the music data to null.
*
* REVISION HISTORY:
* Name Date Description
Expand All @@ -377,7 +378,6 @@ static const SWNoise SW_NOISES[] =
// We've locked in MSG_SOUND_WORKER_MUSIC_PLAY()
MemUnlock(OptrToHandle(pself->SWI_musicData));
pself->SWI_musicData = NullOptr;
pself->SWI_musicPart = NullOptr;
}
}

Expand Down Expand Up @@ -512,15 +512,13 @@ static const SWNoise SW_NOISES[] =
if (v->state == SW_NOISE_VOICE_STATE_PLAYING && ((currentTicks - v->startTicks) > SW_NOISES[v->noise].duration))
{
v->state = SW_NOISE_VOICE_STATE_FREE;
v->noise = 0; // XXX: Unneeded?
v->startTicks = 0; // XXX: Unneeded?
}
}
// Never play multiple noises of the same type at the same time
for (i = 0; i < pself->SWI_numNoiseVoices; i++)
{
v = &pself->SWI_noiseVoices[i];
if (v->noise == noise && v->state == SW_NOISE_VOICE_STATE_ADDED)
if (v->state == SW_NOISE_VOICE_STATE_ADDED && v->noise == noise)
{
return;
}
Expand All @@ -533,7 +531,6 @@ static const SWNoise SW_NOISES[] =
{
v->state = SW_NOISE_VOICE_STATE_ADDED;
v->noise = noise;
v->startTicks = currentTicks;
return;
}
}
Expand All @@ -544,7 +541,6 @@ static const SWNoise SW_NOISES[] =
if (v->noise == noise)
{
v->state = SW_NOISE_VOICE_STATE_ADDED;
v->startTicks = currentTicks;
return;
}
}
Expand All @@ -556,7 +552,6 @@ static const SWNoise SW_NOISES[] =
{
v->state = SW_NOISE_VOICE_STATE_ADDED;
v->noise = noise;
v->startTicks = currentTicks;
return;
}
}
Expand Down Expand Up @@ -586,6 +581,7 @@ static const SWNoise SW_NOISES[] =
***********************************************************************/
@method SoundWorkerClass, MSG_SOUND_WORKER_NOISE_PLAY_MULTI
{
dword currentTicks;
word i;
const SWNoise *n;
SWNoiseVoice *v;
Expand All @@ -594,20 +590,29 @@ static const SWNoise SW_NOISES[] =
{
return;
}
// Get current up time ticks
currentTicks = TimerGetCount();
// Search and play all noises
for (i = 0; i < pself->SWI_numNoiseVoices; i++)
{
// Get a pointer to our voice
v = &pself->SWI_noiseVoices[i];
// We only play voices with the added state
if (v->state == SW_NOISE_VOICE_STATE_ADDED)
{
// Verify we have a valid sound handle
if (v->soundHandle == NullHandle)
{
continue;
}
// Make sure no other noise is playing
SoundStopMusicNote(v->soundHandle);
// Get the noise and play it
n = &SW_NOISES[v->noise];
SoundReallocMusicNote(v->soundHandle, n->frequency, n->loudness, SSDTT_TICKS, n->duration, n->instrument, IT_STANDARD_TABLE);
SoundPlayMusicNote(v->soundHandle, SP_STANDARD + SP_IMMEDIATE, 0, UNLOCK_ON_EOS);
v->state = SW_NOISE_VOICE_STATE_PLAYING;
v->startTicks = currentTicks;
}
}
}
Expand Down Expand Up @@ -642,8 +647,9 @@ static const SWNoise SW_NOISES[] =
{
return;
}
// Verify we have a valid sound handle
// Get a pointer to our voice
v = &pself->SWI_noiseVoices[0];
// Verify we have a valid sound handle
if (v->soundHandle == NullHandle)
{
return;
Expand Down
1 change: 0 additions & 1 deletion Appl/Games/GeoLadder/Main/sndwork.goh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ typedef struct
@instance word SWI_modes = SW_MODE_OFF;
@instance MemHandle SWI_musicHandle = NullHandle;
@instance optr SWI_musicData = NullOptr;
@instance optr SWI_musicPart = NullOptr;
@instance word SWI_musicPartCount = 0;
@instance word SWI_musicPartIndex = 0;
@instance word SWI_numNoiseVoices = 0;
Expand Down
2 changes: 1 addition & 1 deletion Appl/Games/GeoLadder/Main/visobj.goc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void _pascal ClearText(word pos, word len)
x = (pos % SCN_COLS) * g.ns.font.width;
y = (pos / SCN_COLS) * g.ns.font.height;
GrFillRect(g.ns.gstateHandle,
x, y,
x, y + 1,
x + len * g.ns.font.width, y + g.ns.font.height + 1);
}

Expand Down
1 change: 1 addition & 0 deletions Appl/Games/GeoLadder/geoladder.rev
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
R 0.7.1.0 <bolle732> <14:16:44 Jan 2, 2025> <Updated instance variables and noise tables>
R 0.7.0.977 <unknown> <22:32:15 Nov 15, 2024> <>
R 0.7.0.976 <unknown> <22:22:29 Nov 15, 2024> <>
R 0.7.0.975 <unknown> <0:02:16 Nov 15, 2024> <>
Expand Down
69 changes: 35 additions & 34 deletions Driver/Video/VGAlike/VGA16/vga16.rev
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
R 6.0.0.0 <bluewaysw> <15:25:29 Nov 19, 2023> <Prepare FreeGEOS 6.0 release.>
R 6.0.0.13 <frehwagen> <10:18:22 Nov 9, 2021> <bluewaysw>
R 6.0.0.12 <frehwagen> <17:34:19 Nov 8, 2021> <bluewaysw>
R 6.0.0.11 <frehwagen> <10:27:55 May 12, 2021> <bluewaysw>
R 6.0.0.10 <frehwagen> <20:03:19 Nov 22, 2020> <bluewaysw>
R 6.0.0.6 <frehwagen> <14:07:12 Nov 15, 2020> <bluewaysw>
R 6.0.0.1 <frehwagen> <15:25:54 Feb 2, 2020> <bluewaysw>
R 4.1.0.0 <Administrator> <15:25:54 Feb 10, 2004> <BBox>
R 4.0.2.0 <Administrator> <10:34:33 Sep 25, 2002> <BBox>
R 4.0.1.0 <Administrator> <11:51:30 Jul 11, 2002> <BBox>
R 3.1.30.0 <jonl> <14:53:58 Oct 30, 2000> <GPC>
R 3.1.212.0 <jonl> <12:35:06 Jul 11, 2000> <GPC>
R 3.1.211.0 <jonl> <16:30:40 Jun 12, 2000> <GPC>
R 3.1.2.0 <jonl> <15:12:17 Mar 29, 2000> <>
R 3.1.01.0 <jonl> <14:54:00 Mar 24, 2000> <GPC>
R 3.1.40.0 <jonl> <19:52:04 Mar 14, 19100> <>
R 3.1.39.0 <jonl> <23:53:01 Mar 1, 19100> <>
R 3.1.38.0 <jonl> <15:47:51 Feb 23, 19100> <>
R 3.1.37.0 <jonl> <16:12:19 Feb 14, 19100> <>
R 3.1.36.0 <jonl> <14:09:29 Feb 5, 19100> <>
R 3.1.35.0 <jkirkpat> <12:41:39 Jan 28, 19100> <>
R 3.1.34.0 <jkirkpat> <13:15:59 Jan 14, 19100> <>
R 3.1.33.0 <jkirkpat> <15:20:16 Jan 5, 19100> <>
R 3.1.32.0 <jkirkpat> <15:02:14 Jan 5, 19100> <>
R 3.1.31.0 <jkirkpat> <21:07:47 Dec 8, 1999> <>
R 3.1.30.0 <jkirkpat> <12:54:22 Nov 30, 1999> <>
R 3.1.29.0 <jkirkpat> <18:50:05 Nov 17, 1999> <>
R 3.1.28.0 <jkirkpat> <19:40:29 Nov 9, 1999> <>
R 3.1.27.0 <jkirkpat> <16:38:01 Oct 29, 1999> <>
R 3.1.26.0 <jkirkpat> <15:34:59 Oct 29, 1999> <>
R 3.1.25.0 <jkirkpat> <17:57:25 Oct 16, 1999> <>
R 3.1.24.0 <jkirkpat> <14:01:14 Oct 8, 1999> <GPC>
P 0.0 <joon> <18:06:50 Sep 28, 1998> <>
R 0.0.0.0 <joon> <18:06:50 Sep 28, 1998> <>
R 6.0.1.0 <bolle732> <23:01:48 Jan 1, 2025> <New video resolutions>
R 6.0.0.0 <bluewaysw> <15:25:29 Nov 19, 2023> <Prepare FreeGEOS 6.0 release.>
R 6.0.0.13 <frehwagen> <10:18:22 Nov 9, 2021> <bluewaysw>
R 6.0.0.12 <frehwagen> <17:34:19 Nov 8, 2021> <bluewaysw>
R 6.0.0.11 <frehwagen> <10:27:55 May 12, 2021> <bluewaysw>
R 6.0.0.10 <frehwagen> <20:03:19 Nov 22, 2020> <bluewaysw>
R 6.0.0.6 <frehwagen> <14:07:12 Nov 15, 2020> <bluewaysw>
R 6.0.0.1 <frehwagen> <15:25:54 Feb 2, 2020> <bluewaysw>
R 4.1.0.0 <Administrator> <15:25:54 Feb 10, 2004> <BBox>
R 4.0.2.0 <Administrator> <10:34:33 Sep 25, 2002> <BBox>
R 4.0.1.0 <Administrator> <11:51:30 Jul 11, 2002> <BBox>
R 3.1.30.0 <jonl> <14:53:58 Oct 30, 2000> <GPC>
R 3.1.212.0 <jonl> <12:35:06 Jul 11, 2000> <GPC>
R 3.1.211.0 <jonl> <16:30:40 Jun 12, 2000> <GPC>
R 3.1.2.0 <jonl> <15:12:17 Mar 29, 2000> <>
R 3.1.01.0 <jonl> <14:54:00 Mar 24, 2000> <GPC>
R 3.1.40.0 <jonl> <19:52:04 Mar 14, 19100> <>
R 3.1.39.0 <jonl> <23:53:01 Mar 1, 19100> <>
R 3.1.38.0 <jonl> <15:47:51 Feb 23, 19100> <>
R 3.1.37.0 <jonl> <16:12:19 Feb 14, 19100> <>
R 3.1.36.0 <jonl> <14:09:29 Feb 5, 19100> <>
R 3.1.35.0 <jkirkpat> <12:41:39 Jan 28, 19100> <>
R 3.1.34.0 <jkirkpat> <13:15:59 Jan 14, 19100> <>
R 3.1.33.0 <jkirkpat> <15:20:16 Jan 5, 19100> <>
R 3.1.32.0 <jkirkpat> <15:02:14 Jan 5, 19100> <>
R 3.1.31.0 <jkirkpat> <21:07:47 Dec 8, 1999> <>
R 3.1.30.0 <jkirkpat> <12:54:22 Nov 30, 1999> <>
R 3.1.29.0 <jkirkpat> <18:50:05 Nov 17, 1999> <>
R 3.1.28.0 <jkirkpat> <19:40:29 Nov 9, 1999> <>
R 3.1.27.0 <jkirkpat> <16:38:01 Oct 29, 1999> <>
R 3.1.26.0 <jkirkpat> <15:34:59 Oct 29, 1999> <>
R 3.1.25.0 <jkirkpat> <17:57:25 Oct 16, 1999> <>
R 3.1.24.0 <jkirkpat> <14:01:14 Oct 8, 1999> <GPC>
P 0.0 <joon> <18:06:50 Sep 28, 1998> <>
R 0.0.0.0 <joon> <18:06:50 Sep 28, 1998> <>
16 changes: 16 additions & 0 deletions Driver/Video/VGAlike/VGA16/vga16Admin.asm
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,18 @@ VidTestVESA_848x480_16 proc near
ret
VidTestVESA_848x480_16 endp

VidTestVESA_960x540_16 proc near
mov ax, VD_VESA_960x540_16
call VidTestVESA
ret
VidTestVESA_960x540_16 endp

VidTestVESA_960x600_16 proc near
mov ax, VD_VESA_960x600_16
call VidTestVESA
ret
VidTestVESA_960x600_16 endp

VidTestVESA_1024_600_16 proc near
mov ax, VD_VESA_1024_600_16
call VidTestVESA
Expand Down Expand Up @@ -894,6 +906,8 @@ ifndef PRODUCT_WIN_DEMO
word 480 ; VD_VESA_800x480_16
word 624 ; VD_VESA_832x624_16
word 480 ; VD_VESA_848x480_16
word 540 ; VD_VESA_960x540_16
word 600 ; VD_VESA_960x600_16
word 600 ; VD_VESA_1024_600_16

word 768 ; VD_VESA_1Kx768_16
Expand Down Expand Up @@ -933,6 +947,8 @@ ifndef PRODUCT_WIN_DEMO
word 800 ; VD_VESA_800x480_16
word 832 ; VD_VESA_832x624_16
word 848 ; VD_VESA_848x480_16
word 960 ; VD_VESA_960x540_16
word 960 ; VD_VESA_960x600_16
word 1024 ; VD_VESA_1024_600_16

word 1024 ; VD_VESA_1Kx768_16
Expand Down
6 changes: 6 additions & 0 deletions Driver/Video/VGAlike/VGA16/vga16StringTab.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ VD_VESA_720x400_16 enum VideoDevice
VD_VESA_800x480_16 enum VideoDevice
VD_VESA_832x624_16 enum VideoDevice
VD_VESA_848x480_16 enum VideoDevice
VD_VESA_960x540_16 enum VideoDevice
VD_VESA_960x600_16 enum VideoDevice
VD_VESA_1024_600_16 enum VideoDevice

VD_VESA_1Kx768_16 enum VideoDevice
Expand Down Expand Up @@ -82,6 +84,8 @@ ifndef PRODUCT_WIN_DEMO
VGA800_480String,
VGA832_624String,
VGA848_480String,
VGA960_540String,
VGA960_600String,
VGA1024_600String,
UVGAString, ; VD_VESA_1Kx768_16
VGA1152_864String,
Expand Down Expand Up @@ -120,6 +124,8 @@ LocalDefString VGA720_400String <"VESA Compatible SuperVGA: 720x400 64K-color",0
LocalDefString VGA800_480String <"VESA Compatible SuperVGA: 800x480 64K-color",0>
LocalDefString VGA832_624String <"VESA Compatible SuperVGA: 832x624 64K-color",0>
LocalDefString VGA848_480String <"VESA Compatible SuperVGA: 848x480 64K-color",0>
LocalDefString VGA960_540String <"VESA Compatible SuperVGA: 960x540 64K-color",0>
LocalDefString VGA960_600String <"VESA Compatible SuperVGA: 960x600 64K-color",0>
LocalDefString VGA1024_600String <"VESA Compatible SuperVGA: 1024x600 64K-color",0>

LocalDefString UVGAString <"VESA Compatible SuperVGA: 1024x768 64K-color",0>
Expand Down
4 changes: 4 additions & 0 deletions Driver/Video/VGAlike/VGA16/vga16Tables.asm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ ifndef PRODUCT_WIN_DEMO
nptr offset VidTestVESA_800x480_16 ; VD_VESA_800x480_16
nptr offset VidTestVESA_832x624_16 ; VD_VESA_832x624_16
nptr offset VidTestVESA_848x480_16 ; VD_VESA_848x480_16
nptr offset VidTestVESA_960x540_16 ; VD_VESA_960x540_16
nptr offset VidTestVESA_960x600_16 ; VD_VESA_960x600_16
nptr offset VidTestVESA_1024_600_16 ; VD_VESA_1024_600_16

nptr offset VidTestUVGA16 ; VD_VESA_1Kx768_16
Expand Down Expand Up @@ -198,6 +200,8 @@ ifndef PRODUCT_WIN_DEMO
nptr offset VidSetVESA ; VD_VESA_800x480_16
nptr offset VidSetVESA ; VD_VESA_832x624_16
nptr offset VidSetVESA ; VD_VESA_848x480_16
nptr offset VidSetVESA ; VD_VESA_960x540_16
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is an leaning from the last weeks, that it is helpful to increase the "change" number of the geode version at least if some property of a geode changes, as new entries in the list of devices. This will cause the cache in the device driver list to be rerendered so the new entries become available automatically.

nptr offset VidSetVESA ; VD_VESA_960x600_16
nptr offset VidSetVESA ; VD_VESA_1024_600_16

nptr offset VidSetVESA ; VD_VESA_1Kx768_16
Expand Down