mirror of
https://github.com/InvisibleUp/uvmac.git
synced 2024-12-21 16:30:04 +00:00
Remove obsolete platform code
This commit is contained in:
parent
8423f06d38
commit
c0b9b7bcea
File diff suppressed because it is too large
Load Diff
@ -1,228 +0,0 @@
|
||||
/*
|
||||
SGLUDDSP.h
|
||||
|
||||
Copyright (C) 2012 Paul C. Pratt
|
||||
|
||||
You can redistribute this file and/or modify it under the terms
|
||||
of version 2 of the GNU General Public License as published by
|
||||
the Free Software Foundation. You should have received a copy
|
||||
of the license along with this file; see the file COPYING.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
license for more details.
|
||||
*/
|
||||
|
||||
/*
|
||||
Sound GLUe for "/Dev/DSP"
|
||||
OSS and related, accessed through "/dev/dsp"
|
||||
*/
|
||||
|
||||
LOCALVAR int audio_fd = -1;
|
||||
LOCALVAR bool audio_started;
|
||||
|
||||
#if 4 == kLn2SoundSampSz
|
||||
LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = kOneBuffLen; --i >= 0; ) {
|
||||
*p++ -= 0x8000;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define ConvertSoundBlockToNative(p)
|
||||
#endif
|
||||
|
||||
LOCALPROC Sound_WriteOut(void)
|
||||
{
|
||||
int retry_count = 32;
|
||||
|
||||
label_retry:
|
||||
if (--retry_count > 0) {
|
||||
int err;
|
||||
struct audio_buf_info info;
|
||||
|
||||
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) != 0) {
|
||||
fprintf(stderr, "SNDCTL_DSP_GETOSPACE fails\n");
|
||||
} else {
|
||||
tpSoundSamp NextPlayPtr;
|
||||
uint16_t PlayNowSize = 0;
|
||||
uint16_t MaskedFillOffset = ThePlayOffset & kOneBuffMask;
|
||||
uint16_t PrivateBuffUsed = TheFillOffset - ThePlayOffset;
|
||||
int used = (info.fragstotal * info.fragsize) - info.bytes;
|
||||
|
||||
if (audio_started) {
|
||||
uint16_t TotPendBuffs = used >> kLnOneBuffSz;
|
||||
|
||||
if (TotPendBuffs < MinFilledSoundBuffs) {
|
||||
MinFilledSoundBuffs = TotPendBuffs;
|
||||
}
|
||||
/* fprintf(stderr, "buffer used %d\n", (int)used); */
|
||||
} else {
|
||||
if (PrivateBuffUsed >= kAllBuffLen - kOneBuffLen) {
|
||||
audio_started = true;
|
||||
} else {
|
||||
info.bytes = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (MaskedFillOffset != 0) {
|
||||
/* take care of left overs */
|
||||
PlayNowSize = kOneBuffLen - MaskedFillOffset;
|
||||
NextPlayPtr =
|
||||
TheSoundBuffer + (ThePlayOffset & kAllBuffMask);
|
||||
} else if (0 !=
|
||||
((TheFillOffset - ThePlayOffset) >> kLnOneBuffLen))
|
||||
{
|
||||
PlayNowSize = kOneBuffLen;
|
||||
NextPlayPtr =
|
||||
TheSoundBuffer + (ThePlayOffset & kAllBuffMask);
|
||||
} else {
|
||||
/* nothing to play now */
|
||||
}
|
||||
|
||||
#if 4 == kLn2SoundSampSz
|
||||
PlayNowSize <<= 1;
|
||||
#endif
|
||||
|
||||
if (PlayNowSize > info.bytes) {
|
||||
PlayNowSize = info.bytes;
|
||||
}
|
||||
|
||||
if (0 != PlayNowSize) {
|
||||
err = write(
|
||||
audio_fd, NextPlayPtr, PlayNowSize);
|
||||
if (err < 0) {
|
||||
if (- EAGAIN == err) {
|
||||
/* buffer full, try again later */
|
||||
fprintf(stderr, "pcm write: EAGAIN\n");
|
||||
} else if (- EPIPE == err) {
|
||||
/* buffer seems to have emptied */
|
||||
fprintf(stderr, "pcm write emptied\n");
|
||||
goto label_retry;
|
||||
} else {
|
||||
fprintf(stderr, "audio_fd write error: %d\n",
|
||||
err);
|
||||
}
|
||||
} else {
|
||||
ThePlayOffset += err
|
||||
#if 4 == kLn2SoundSampSz
|
||||
>> 1
|
||||
#endif
|
||||
;
|
||||
goto label_retry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC Sound_Start(void)
|
||||
{
|
||||
if (audio_fd >= 0) {
|
||||
Sound_Start0();
|
||||
audio_started = false;
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC Sound_Stop(void)
|
||||
{
|
||||
if (audio_fd >= 0) {
|
||||
if (0 !=
|
||||
ioctl(audio_fd, SNDCTL_DSP_RESET /* SNDCTL_DSP_HALT */,
|
||||
NULL))
|
||||
{
|
||||
fprintf(stderr, "SNDCTL_DSP_RESET fails\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 4 == kLn2SoundSampSz
|
||||
#define DesiredFormat AFMT_S16_NE
|
||||
#else
|
||||
#define DesiredFormat AFMT_U8
|
||||
#endif
|
||||
|
||||
LOCALFUNC bool Sound_Init(void)
|
||||
{
|
||||
bool IsOk = false;
|
||||
|
||||
audio_fd = open(AudioDevPath, O_WRONLY, 0);
|
||||
if (audio_fd < 0) {
|
||||
fprintf(stderr, "open /dev/dsp fails: %d\n", audio_fd);
|
||||
} else {
|
||||
int fragment_value = (16 /* 16 fragments */ << 16)
|
||||
#if 4 == kLn2SoundSampSz
|
||||
| 10 /* of 1024 bytes */
|
||||
#else
|
||||
| 9 /* of 512 bytes */
|
||||
#endif
|
||||
;
|
||||
int channels_value = 1;
|
||||
int fmt_value = DesiredFormat;
|
||||
int speed_value = SOUND_SAMPLERATE;
|
||||
|
||||
/* fprintf(stderr, "open /dev/dsp works\n"); */
|
||||
|
||||
if (0 !=
|
||||
ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &fragment_value))
|
||||
{
|
||||
fprintf(stderr, "SNDCTL_DSP_SETFRAGMENT fails\n");
|
||||
} else if ((0 !=
|
||||
ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &channels_value))
|
||||
|| (channels_value != 1))
|
||||
{
|
||||
fprintf(stderr, "SNDCTL_DSP_CHANNELS fails\n");
|
||||
} else if ((0 !=
|
||||
ioctl(audio_fd, SNDCTL_DSP_SETFMT, &fmt_value))
|
||||
|| (fmt_value != DesiredFormat))
|
||||
{
|
||||
fprintf(stderr, "SNDCTL_DSP_SETFMT fails\n");
|
||||
} else if ((0 !=
|
||||
ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed_value))
|
||||
|| (speed_value != SOUND_SAMPLERATE))
|
||||
{
|
||||
fprintf(stderr, "SNDCTL_DSP_SPEED fails\n");
|
||||
} else
|
||||
{
|
||||
IsOk = true;
|
||||
}
|
||||
|
||||
if (! IsOk) {
|
||||
(void) close(audio_fd);
|
||||
audio_fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return true; /* keep going, even if no sound */
|
||||
}
|
||||
|
||||
LOCALPROC Sound_UnInit(void)
|
||||
{
|
||||
if (audio_fd >= 0) {
|
||||
if (close(audio_fd) != 0) {
|
||||
fprintf(stderr, "close /dev/dsp fails\n");
|
||||
}
|
||||
audio_fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC Sound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (Sound_EndWrite0(actL)) {
|
||||
ConvertSoundBlockToNative(TheSoundBuffer
|
||||
+ ((TheFillOffset - kOneBuffLen) & kAllBuffMask));
|
||||
if (audio_fd >= 0) {
|
||||
Sound_WriteOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC Sound_SecondNotify(void)
|
||||
{
|
||||
if (audio_fd >= 0) {
|
||||
Sound_SecondNotify0();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,192 +0,0 @@
|
||||
/*
|
||||
AppIcon.r
|
||||
|
||||
Copyright (C) 2003 Philip Cummins, Richard F. Bannister,
|
||||
Paul C. Pratt
|
||||
|
||||
You can redistribute this file and/or modify it under the terms
|
||||
of version 2 of the GNU General Public License as published by
|
||||
the Free Software Foundation. You should have received a copy
|
||||
of the license along with this file; see the file COPYING.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
license for more details.
|
||||
*/
|
||||
|
||||
#if SmallIconAPIAvail
|
||||
resource 'ics#' (AppIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"0000 1FF8 2004 2FF4 2814 2A94 2B14 2A14"
|
||||
$"2814 2FF4 2004 2004 20F4 2004 1FF8 1FF8",
|
||||
/* [2] */
|
||||
$"0000 1FF8 3FFC 3FFC 3FFC 3FFC 3FFC 3FFC"
|
||||
$"3FFC 3FFC 3FFC 3FFC 3FFC 3FFC 1FF8 1FF8"
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics8' (AppIconId, purgeable) {
|
||||
$"0000 0000 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FF00 0000"
|
||||
$"0000 FF2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000"
|
||||
$"0000 FF2B FCFC FCFC FCFC FCFC 2BFF 0000"
|
||||
$"0000 FF2B FC2A 2A2A 2A2A 2A00 2BFF 0000"
|
||||
$"0000 FF2B FC2A EC2A EC2A 2A00 2BFF 0000"
|
||||
$"0000 FF2B FC2A ECEC 2A2A 2A00 2BFF 0000"
|
||||
$"0000 FF2B FC2A EC2A 2A2A 2A00 2BFF 0000"
|
||||
$"0000 FF2B FC2A 2A2A 2A2A 2A00 2BFF 0000"
|
||||
$"0000 FF2B FA00 0000 0000 0000 2BFF 0000"
|
||||
$"0000 FF2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000"
|
||||
$"0000 FF2B E32B 2B2B 2B2B 2B2B 2BFF 0000"
|
||||
$"0000 FF2B D82B 2B2B FFFF FFFF 2BFF 0000"
|
||||
$"0000 FF2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000"
|
||||
$"0000 00FD FDFD FDFD FDFF FFFF FF00 0000"
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics4' (AppIconId, purgeable) {
|
||||
$"0000 0000 0000 0000 000F FFFF FFFF F000"
|
||||
$"00FC CCCC CCCC CF00 00FC EEEE EEEE CF00"
|
||||
$"00FC ED0D 0D0C CF00 00FC E060 60D0 CF00"
|
||||
$"00FC ED66 0D0C CF00 00FC E060 D0D0 CF00"
|
||||
$"00FC ED0D 0D0C CF00 00FC D0C0 C0C0 CF00"
|
||||
$"00FC CCCC CCCC CF00 00FC 8CCC CCCC CF00"
|
||||
$"00FC 3CCC FFFF CF00 00FC CCCC CCCC CF00"
|
||||
$"000F FFFF FFFF F000 000F FFFF FFFF F0"
|
||||
};
|
||||
#endif
|
||||
|
||||
resource 'ICN#' (AppIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"0000 0000 07FF FFE0 0800 0010 0800 0010"
|
||||
$"08FF FF10 0900 0090 0918 1890 0918 3090"
|
||||
$"0918 6090 0918 C090 0919 8090 091B 0090"
|
||||
$"091E 0090 091C 0090 0918 0090 0910 0090"
|
||||
$"0900 0090 08FF FF10 0800 0010 0800 0010"
|
||||
$"0800 0010 0800 0010 0800 FF10 0800 0010"
|
||||
$"0800 0010 0800 0010 0800 0010 07FF FFE0"
|
||||
$"0400 0020 0400 0020 0400 0020 07FF FFE0",
|
||||
/* [2] */
|
||||
$"0000 0000 07FF FFE0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 0FFF FFF0"
|
||||
$"0FFF FFF0 0FFF FFF0 0FFF FFF0 07FF FFE0"
|
||||
$"07FF FFE0 07FF FFE0 07FF FFE0 07FF FFE0"
|
||||
}
|
||||
};
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl8' (AppIconId, purgeable) {
|
||||
$"0000 0000 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B FCFC FCFC FCFC FCFC"
|
||||
$"FCFC FCFC FCFC FCFC 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2A2A 2A2A 2A2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2A2A"
|
||||
$"2A2A 2AEC EC2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2A2A"
|
||||
$"2A2A ECEC 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2A2A"
|
||||
$"2AEC EC2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2A2A"
|
||||
$"ECEC 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2AEC"
|
||||
$"EC2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A ECEC"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC ECEC EC2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC ECEC 2A2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC EC2A 2A2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2AEC 2A2A 2A2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BFC 2A2A 2A2A 2A2A 2A2A"
|
||||
$"2A2A 2A2A 2A2A 2A2A 002B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"FFFF FFFF FFFF FFFF 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"0000 0000 0000 0000 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BE3 E32B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2BD8 D82B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 FF2B 2B2B 2B2B 2B2B 2B2B 2B2B"
|
||||
$"2B2B 2B2B 2B2B 2B2B 2B2B 2BFF 0000 0000"
|
||||
$"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF FFFF FFFF FF00 0000 0000"
|
||||
$"0000 0000 00FF FBFB FBFB FBFB FCFC FCFC"
|
||||
$"FCFD FDFD FDFD FDFD FDFD FF00 0000 0000"
|
||||
$"0000 0000 00FF FAFA FAFA FAFA FAFA FBFB"
|
||||
$"FCFC FCFC FDFD FDFD FDFD FF00 0000 0000"
|
||||
$"0000 0000 00FF F9F9 F9F9 F9F9 F9F9 FAFA"
|
||||
$"FAFB FBFC FCFC FCFD FDFD FF00 0000 0000"
|
||||
$"0000 0000 00FF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF FFFF FFFF FF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl4' (AppIconId, purgeable) {
|
||||
$"0000 0000 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0FFF FFFF FFFF FFFF FFFF FFF0 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC EEEE EEEE EEEE EEEE CCCF 0000"
|
||||
$"0000 FCCE 0D0D 0D0D 0D0D 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D6 60D0 D0D6 60D0 CCCF 0000"
|
||||
$"0000 FCCE 0D06 6D0D 0D66 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D6 60D0 D660 D0D0 CCCF 0000"
|
||||
$"0000 FCCE 0D06 6D0D 660D 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D6 60D6 60D0 D0D0 CCCF 0000"
|
||||
$"0000 FCCE 0D06 6D66 0D0D 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D6 6660 D0D0 D0D0 CCCF 0000"
|
||||
$"0000 FCCE 0D06 660D 0D0D 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D6 60D0 D0D0 D0D0 CCCF 0000"
|
||||
$"0000 FCCE 0D06 0D0D 0D0D 0D0D 0CCF 0000"
|
||||
$"0000 FCCE D0D0 D0D0 D0D0 D0D0 CCCF 0000"
|
||||
$"0000 FCCC 0C0C 0C0C 0C0C 0C0C 0CCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC FFFF FFFF CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC 0C0C 0C0C CCCF 0000"
|
||||
$"0000 FCC8 8CCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCC3 3CCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 FCCC CCCC CCCC CCCC CCCC CCCF 0000"
|
||||
$"0000 0FFF FFFF FFFF FFFF FFFF FFF0 0000"
|
||||
$"0000 0FEE EEEE EEEE EEFF FFFF FFF0 0000"
|
||||
$"0000 0FDD DDDD DDEE EEEE EEFF FFF0 0000"
|
||||
$"0000 0FDD DDDD DDDD DEEE EEEE EEF0 0000"
|
||||
$"0000 0FFF FFFF FFFF FFFF FFFF FFF0"
|
||||
};
|
||||
#endif
|
@ -1,192 +0,0 @@
|
||||
/*
|
||||
DskIcon.r
|
||||
|
||||
Copyright (C) 2003 Philip Cummins, Richard F. Bannister,
|
||||
Paul C. Pratt
|
||||
|
||||
You can redistribute this file and/or modify it under the terms
|
||||
of version 2 of the GNU General Public License as published by
|
||||
the Free Software Foundation. You should have received a copy
|
||||
of the license along with this file; see the file COPYING.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
license for more details.
|
||||
*/
|
||||
|
||||
#if SmallIconAPIAvail
|
||||
resource 'ics#' (DskIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"7FE0 4030 4028 403C 4004 4004 4004 4FC4"
|
||||
$"4AA4 4BA4 4824 4BA4 4AA4 4FE4 4004 7FFC",
|
||||
/* [2] */
|
||||
$"7FE0 7FF0 7FF8 7FFC 7FFC 7FFC 7FFC 7FFC"
|
||||
$"7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC"
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics8' (DskIconId, purgeable) {
|
||||
$"00FF FFFF FFFF FFFF FFFF FF00 0000 0000"
|
||||
$"00FF 0000 0000 0000 0000 FFFF 0000 0000"
|
||||
$"00FF 0000 0000 0000 0000 FF2A FF00 0000"
|
||||
$"00FF 0000 0000 0000 0000 FFFF FFFF 0000"
|
||||
$"00FF 0000 0000 0000 0000 00FA FAFF 0000"
|
||||
$"00FF 0000 0000 0000 0000 0000 00FF 0000"
|
||||
$"00FF 0000 0000 0000 0000 0000 00FF 0000"
|
||||
$"00FF 0000 E0E0 E0E0 E0E0 0000 00FF 0000"
|
||||
$"00FF 0000 E054 AB2A AB54 E000 00FF 0000"
|
||||
$"00FF 0000 E054 ABAB AB54 E000 00FF 0000"
|
||||
$"00FF 0000 E054 5454 5454 E000 00FF 0000"
|
||||
$"00FF 0000 E054 ABAB AB54 E000 00FF 0000"
|
||||
$"00FF 0000 E054 AB2A AB54 E000 00FF 0000"
|
||||
$"00FF 0000 E0FF E0E0 E0E0 E000 00FF 0000"
|
||||
$"00FF 0000 0000 0000 0000 0000 00FF 0000"
|
||||
$"00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics4' (DskIconId, purgeable) {
|
||||
$"0FFF FFFF FFF0 0000 0F00 0000 00FF 0000"
|
||||
$"0F00 0000 00FC F000 0F00 0000 00FF FF00"
|
||||
$"0F00 0000 000D DF00 0F00 0000 0000 0F00"
|
||||
$"0F00 0000 0000 0F00 0F00 FFFF FF00 0F00"
|
||||
$"0F00 FCE0 ECF0 0F00 0F00 FCEE ECF0 0F00"
|
||||
$"0F00 FCCC CCF0 0F00 0F00 FCEE ECF0 0F00"
|
||||
$"0F00 FCE0 ECF0 0F00 0F00 FFFF FFF0 0F00"
|
||||
$"0F00 0000 0000 0F00 0FFF FFFF FFFF FF"
|
||||
};
|
||||
#endif
|
||||
|
||||
resource 'ICN#' (DskIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"1FFF F800 1000 0C00 1000 0A00 1000 0900"
|
||||
$"1000 0880 1000 0840 1000 0820 1000 0FF0"
|
||||
$"1000 0010 1000 0010 1000 0010 1000 0010"
|
||||
$"1000 0010 10FF FC10 1120 9210 1121 5110"
|
||||
$"1121 5110 1121 5110 1120 9110 111F E110"
|
||||
$"1100 0110 1100 0110 111F F110 1120 0910"
|
||||
$"1120 0910 1122 8910 1123 0910 1122 0910"
|
||||
$"1120 0910 10FF FE10 1000 0010 1FFF FFF0",
|
||||
/* [2] */
|
||||
$"1FFF F800 1FFF FC00 1FFF FE00 1FFF FF00"
|
||||
$"1FFF FF80 1FFF FFC0 1FFF FFE0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
}
|
||||
};
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl8' (DskIconId, purgeable) {
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FF00 0000 0000 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FFFF 0000 0000 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FF2A FF00 0000 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FF2A 2AFF 0000 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FF2A 2A2A FF00 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FF2A 2A2A 2AFF 0000 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FF2A 2A2A 2A2A FF00 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 FFFF FFFF FFFF FFFF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 00FA FAFA FAFA FAFF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00F5 E0FF E0E0 E0E0 E0E0"
|
||||
$"E0E0 E0E0 E0E0 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2AFA"
|
||||
$"FFFA 2AAB 5454 E000 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2AFF"
|
||||
$"00FF 2AAB 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2AFF"
|
||||
$"00FF 2AAB 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2AFF"
|
||||
$"00FF 2AAB 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2AFA"
|
||||
$"FFFA 2AAB 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 54AB ABAB ABAB"
|
||||
$"ABAB AB54 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 5454 5454 5454"
|
||||
$"5454 5454 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 5454 5454 5454"
|
||||
$"5454 5454 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 54AB ABAB ABAB"
|
||||
$"ABAB ABAB 5454 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2A2A"
|
||||
$"2A2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2A2A"
|
||||
$"2A2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A EC2A"
|
||||
$"EC2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A ECEC"
|
||||
$"2A2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A EC2A"
|
||||
$"2A2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00E0 5454 AB2A 2A2A 2A2A"
|
||||
$"2A2A 2A2A AB54 54E0 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 00F5 FFFF E0E0 E0E0 E0E0"
|
||||
$"E0E0 E0E0 FFE0 E0F5 0000 00FF 0000 0000"
|
||||
$"0000 00FF 0000 0000 0000 0000 0000 0000"
|
||||
$"0000 0000 0000 0000 0000 00FF 0000 0000"
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl4' (DskIconId, purgeable) {
|
||||
$"000F FFFF FFFF FFFF FFFF F000 0000 0000"
|
||||
$"000F 0000 0000 0000 0000 FF00 0000 0000"
|
||||
$"000F 0000 0000 0000 0000 F0F0 0000 0000"
|
||||
$"000F 0000 0000 0000 0000 FC0F 0000 0000"
|
||||
$"000F 0000 0000 0000 0000 F0C0 F000 0000"
|
||||
$"000F 0000 0000 0000 0000 FC0C 0F00 0000"
|
||||
$"000F 0000 0000 0000 0000 F0C0 C0F0 0000"
|
||||
$"000F 0000 0000 0000 0000 FFFF FFFF 0000"
|
||||
$"000F 0000 0000 0000 0000 0DDD DDDF 0000"
|
||||
$"000F 0000 0000 0000 0000 0000 000F 0000"
|
||||
$"000F 0000 0000 0000 0000 0000 000F 0000"
|
||||
$"000F 0000 0000 0000 0000 0000 000F 0000"
|
||||
$"000F 0000 0000 0000 0000 0000 000F 0000"
|
||||
$"000F 0000 FFFF FFFF FFFF FF00 000F 0000"
|
||||
$"000F 000F CCEC 0C0D FD0E CCF0 000F 0000"
|
||||
$"000F 000F CCE0 C0CF 0FCE CCCF 000F 0000"
|
||||
$"000F 000F CCEC 0C0F 0F0E CCCF 000F 0000"
|
||||
$"000F 000F CCE0 C0CF 0FCE CCCF 000F 0000"
|
||||
$"000F 000F CCEC 0C0D FD0E CCCF 000F 0000"
|
||||
$"000F 000F CCCE EEEE EEEC CCCF 000F 0000"
|
||||
$"000F 000F CCCC CCCC CCCC CCCF 000F 0000"
|
||||
$"000F 000F CCCC CCCC CCCC CCCF 000F 0000"
|
||||
$"000F 000F CCCE EEEE EEEE CCCF 000F 0000"
|
||||
$"000F 000F CCEC 0C0C 0C0C ECCF 000F 0000"
|
||||
$"000F 000F CCE0 C0C0 C0C0 ECCF 000F 0000"
|
||||
$"000F 000F CCEC 0C6C 6C0C ECCF 000F 0000"
|
||||
$"000F 000F CCE0 C066 C0C0 ECCF 000F 0000"
|
||||
$"000F 000F CCEC 0C6C 0C0C ECCF 000F 0000"
|
||||
$"000F 000F CCE0 C0C0 C0C0 ECCF 000F 0000"
|
||||
$"000F 0000 FFFF FFFF FFFF FFF0 000F 0000"
|
||||
$"000F 0000 0000 0000 0000 0000 000F 0000"
|
||||
$"000F FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
@ -1,192 +0,0 @@
|
||||
/*
|
||||
RomIcon.r
|
||||
|
||||
Copyright (C) 2003 Philip Cummins, Richard F. Bannister,
|
||||
Paul C. Pratt
|
||||
|
||||
You can redistribute this file and/or modify it under the terms
|
||||
of version 2 of the GNU General Public License as published by
|
||||
the Free Software Foundation. You should have received a copy
|
||||
of the license along with this file; see the file COPYING.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
license for more details.
|
||||
*/
|
||||
|
||||
#if SmallIconAPIAvail
|
||||
resource 'ics#' (RomIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"7FE0 4030 4028 403C 4004 5FC4 5FC4 5FC4"
|
||||
$"5FC4 4004 5FC4 5FC4 5FC4 5FC4 4004 7FFC",
|
||||
/* [2] */
|
||||
$"7FE0 7FF0 7FF8 7FFC 7FFC 7FFC 7FFC 7FFC"
|
||||
$"7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC"
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics8' (RomIconId, purgeable) {
|
||||
$"00FF FFFF FFFF FFFF FFFF FF00 0000 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 FFFF 0000 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 FF2B FF00 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 FFFF FFFF 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5FF FFFF FFFF FFFF F5F5 F5FF 0000"
|
||||
$"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000"
|
||||
$"00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'ics4' (RomIconId, purgeable) {
|
||||
$"0FFF FFFF FFF0 0000 0F0C 0C0C 0CFF 0000"
|
||||
$"0FC0 C0C0 C0FC F000 0F0C 0C0C 0CFF FF00"
|
||||
$"0FC0 C0C0 C0C0 CF00 0F0F FFFF FF0C 0F00"
|
||||
$"0FCF FFFF FFC0 CF00 0F0F FFFF FF0C 0F00"
|
||||
$"0FCF FFFF FFC0 CF00 0F0C 0C0C 0C0C 0F00"
|
||||
$"0FCF FFFF FFC0 CF00 0F0F FFFF FF0C 0F00"
|
||||
$"0FCF FFFF FFC0 CF00 0F0F FFFF FF0C 0F00"
|
||||
$"0FC0 C0C0 C0C0 CF00 0FFF FFFF FFFF FF"
|
||||
};
|
||||
#endif
|
||||
|
||||
resource 'ICN#' (RomIconId, purgeable) {
|
||||
{ /* array: 2 elements */
|
||||
/* [1] */
|
||||
$"1FFF FC00 1000 0600 1000 0500 1000 0480"
|
||||
$"1000 0440 1000 0420 1000 07F0 1000 0010"
|
||||
$"1155 5010 12AA A810 13FF F810 13FF F810"
|
||||
$"13FF F810 13FF F810 13FF F810 13FF F810"
|
||||
$"12AA A810 1155 5010 1000 0010 1155 5010"
|
||||
$"12AA A810 13FF F810 13FF F810 13FF F810"
|
||||
$"13FF F810 13FF F810 13FF F810 12AA A810"
|
||||
$"1155 5010 1000 0010 1000 0010 1FFF FFF0",
|
||||
/* [2] */
|
||||
$"1FFF FC00 1FFF FE00 1FFF FF00 1FFF FF80"
|
||||
$"1FFF FFC0 1FFF FFE0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
$"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
|
||||
}
|
||||
};
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl8' (RomIconId, purgeable) {
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF 0000 0000 0000 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF FF00 0000 0000 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF 2BFF 0000 0000 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF 2B2B FF00 0000 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF 2B2B 2BFF 0000 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF 2B2B 2B2B FF00 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5FF FFFF FFFF FFFF 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5FF F5FF F5FF F5FF F5FF"
|
||||
$"F5FF F5FF F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FF00 FF00 FF00 FF00 FF00"
|
||||
$"FF00 FF00 FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FF00 FF00 FF00 FF00 FF00"
|
||||
$"FF00 FF00 FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5FF F5FF F5FF F5FF F5FF"
|
||||
$"F5FF F5FF F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5FF F5FF F5FF F5FF F5FF"
|
||||
$"F5FF F5FF F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FF00 FF00 FF00 FF00 FF00"
|
||||
$"FF00 FF00 FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 FF00 FF00 FF00 FF00 FF00"
|
||||
$"FF00 FF00 FFF5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5FF F5FF F5FF F5FF F5FF"
|
||||
$"F5FF F5FF F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
|
||||
$"F5F5 F5F5 F5F5 F5F5 F5F5 F5FF 0000 0000"
|
||||
$"0000 00FF FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
$"FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ColorIconAPIAvail
|
||||
resource 'icl4' (RomIconId, purgeable) {
|
||||
$"000F FFFF FFFF FFFF FFFF FF00 0000 0000"
|
||||
$"000F 0C0C 0C0C 0C0C 0C0C 0FF0 0000 0000"
|
||||
$"000F C0C0 C0C0 C0C0 C0C0 CFCF 0000 0000"
|
||||
$"000F 0C0C 0C0C 0C0C 0C0C 0FCC F000 0000"
|
||||
$"000F C0C0 C0C0 C0C0 C0C0 CFCC CF00 0000"
|
||||
$"000F 0C0C 0C0C 0C0C 0C0C 0FCC CCF0 0000"
|
||||
$"000F C0C0 C0C0 C0C0 C0C0 CFFF FFFF 0000"
|
||||
$"000F 0C0C 0C0C 0C0C 0C0C 0C0C 0C0F 0000"
|
||||
$"000F C0CF CFCF CFCF CFCF C0C0 C0CF 0000"
|
||||
$"000F 0CF0 F0F0 F0F0 F0F0 FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0F0 F0F0 F0F0 F0F0 F0C0 C0CF 0000"
|
||||
$"000F 0C0F 0F0F 0F0F 0F0F 0C0C 0C0F 0000"
|
||||
$"000F C0C0 C0C0 C0C0 C0C0 C0C0 C0CF 0000"
|
||||
$"000F 0C0F 0F0F 0F0F 0F0F 0C0C 0C0F 0000"
|
||||
$"000F C0F0 F0F0 F0F0 F0F0 F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CFF FFFF FFFF FFFF FC0C 0C0F 0000"
|
||||
$"000F C0FF FFFF FFFF FFFF F0C0 C0CF 0000"
|
||||
$"000F 0CF0 F0F0 F0F0 F0F0 FC0C 0C0F 0000"
|
||||
$"000F C0CF CFCF CFCF CFCF C0C0 C0CF 0000"
|
||||
$"000F 0C0C 0C0C 0C0C 0C0C 0C0C 0C0F 0000"
|
||||
$"000F C0C0 C0C0 C0C0 C0C0 C0C0 C0CF 0000"
|
||||
$"000F FFFF FFFF FFFF FFFF FFFF FFFF"
|
||||
};
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,55 +0,0 @@
|
||||
/*
|
||||
main.r
|
||||
|
||||
Copyright (C) 2003 Philip Cummins, Richard F. Bannister,
|
||||
Paul C. Pratt
|
||||
|
||||
You can redistribute this file and/or modify it under the terms
|
||||
of version 2 of the GNU General Public License as published by
|
||||
the Free Software Foundation. You should have received a copy
|
||||
of the license along with this file; see the file COPYING.
|
||||
|
||||
This file is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
license for more details.
|
||||
*/
|
||||
|
||||
#include "CNFGRSRC.h"
|
||||
|
||||
/* Alerts Constants */
|
||||
|
||||
#define kStandardAlert 128
|
||||
|
||||
resource 'DITL' (kStandardAlert, purgeable) {
|
||||
{ /* array DITLarray: 2 elements */
|
||||
/* [1] */
|
||||
{177, 293, 197, 351},
|
||||
Button {
|
||||
enabled,
|
||||
"OK"
|
||||
},
|
||||
/* [2] */
|
||||
{10, 72, 162, 353},
|
||||
StaticText {
|
||||
disabled,
|
||||
"^0\n\n^1^2^3"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
resource 'ALRT' (kStandardAlert, "Non Fatal Error", purgeable) {
|
||||
{40, 43, 249, 405},
|
||||
kStandardAlert,
|
||||
{ /* array: 4 elements */
|
||||
/* [1] */
|
||||
OK, visible, sound1,
|
||||
/* [2] */
|
||||
OK, visible, sound1,
|
||||
/* [3] */
|
||||
OK, visible, sound1,
|
||||
/* [4] */
|
||||
OK, visible, sound1
|
||||
},
|
||||
alertPositionMainScreen
|
||||
};
|
@ -1,17 +0,0 @@
|
||||
# Deprecated targets
|
||||
|
||||
Targets that I'm not in a position to maintain right now. Perhaps they'll come
|
||||
back from the dead one day. (MACOSX especially; I don't own any computer that
|
||||
runs that at the moment...)
|
||||
|
||||
Do not expect any of these targets to build.
|
||||
|
||||
- `MACOSX`: macOS / Mac OS X
|
||||
- `NDS`: Nintendo DS
|
||||
- `OLDMAC`: Classic Mac OS
|
||||
- `UNIX`: raw X11
|
||||
- `XPLAT/OSGLUGTK.c`: GTK (Linux)
|
||||
- `XPLAT/OSGLUSDL.c`: SDL 1.2 (or lower?); might be useful for archaic systems
|
||||
|
||||
While compatibility with old/esoteric operating systems is neat, the primary
|
||||
focus will be on SDL2 moving forwards.
|
File diff suppressed because it is too large
Load Diff
@ -1,79 +0,0 @@
|
||||
/* --- sending debugging info to file --- */
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include "SYSDEPNS.h"
|
||||
#include "UI/WIN32/OSGLUWIN.h"
|
||||
|
||||
#if dbglog_HAVE
|
||||
|
||||
LOCALVAR HANDLE dbglog_File = INVALID_HANDLE_VALUE;
|
||||
|
||||
LOCALFUNC bool dbglog_open0(void)
|
||||
{
|
||||
TCHAR pathName[_MAX_PATH];
|
||||
TCHAR Child0[] = TEXT("\\dbglog.txt");
|
||||
size_t newlen;
|
||||
|
||||
if (GetAppDir(pathName)) {
|
||||
newlen = _tcslen(pathName) + _tcslen(Child0);
|
||||
if (newlen + 1 < _MAX_PATH) {
|
||||
_tcscat(pathName, Child0);
|
||||
|
||||
dbglog_File = CreateFile(
|
||||
pathName, /* pointer to name of the file */
|
||||
GENERIC_READ + GENERIC_WRITE,
|
||||
/* access (read-write) mode */
|
||||
0, /* share mode */
|
||||
NULL, /* pointer to security descriptor */
|
||||
OPEN_ALWAYS, /* how to create */
|
||||
FILE_ATTRIBUTE_NORMAL, /* file attributes */
|
||||
NULL /* handle to file with attributes to copy */
|
||||
);
|
||||
if (INVALID_HANDLE_VALUE == dbglog_File) {
|
||||
/* report error (how?) */
|
||||
} else if (SetFilePointer(
|
||||
dbglog_File, /* handle of file */
|
||||
0, /* number of bytes to move file pointer */
|
||||
nullpr,
|
||||
/* address of high-order word of distance to move */
|
||||
FILE_BEGIN /* how to move */
|
||||
) != 0)
|
||||
{
|
||||
/* report error (how?) */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (INVALID_HANDLE_VALUE != dbglog_File);
|
||||
}
|
||||
|
||||
LOCALPROC dbglog_write0(char *s, uimr L)
|
||||
{
|
||||
DWORD BytesWritten;
|
||||
|
||||
if (INVALID_HANDLE_VALUE != dbglog_File) {
|
||||
if (! WriteFile(dbglog_File, /* handle of file to read */
|
||||
(LPVOID)s, /* address of buffer that receives data */
|
||||
(DWORD)L, /* number of bytes to read */
|
||||
&BytesWritten, /* address of number of bytes read */
|
||||
nullpr) /* address of structure for data */
|
||||
|| ((uint32_t)BytesWritten != L))
|
||||
{
|
||||
/* report error (how?) */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC dbglog_close0(void)
|
||||
{
|
||||
if (INVALID_HANDLE_VALUE != dbglog_File) {
|
||||
if (! SetEndOfFile(dbglog_File)) {
|
||||
/* report error (how?) */
|
||||
}
|
||||
(void) CloseHandle(dbglog_File);
|
||||
dbglog_File = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,435 +0,0 @@
|
||||
#include <windows.h>
|
||||
#include "SYSDEPNS.h"
|
||||
#include "CNFGGLOB.h"
|
||||
#include "CNFGRAPI.h"
|
||||
#include "HW/KBRD/KEYCODES.h"
|
||||
#include "UI/COMOSGLU.h"
|
||||
#include "UI/WIN32/OSGLUWIN.h"
|
||||
#include "UI/CONTROLM.h"
|
||||
#include "UTIL/ENDIANAC.h"
|
||||
|
||||
/* keyboard */
|
||||
|
||||
static uint8_t WinKey2Mac[256];
|
||||
|
||||
static inline void AssignOneMacKey(uint8_t WinKey, uint8_t MacKey)
|
||||
{
|
||||
WinKey2Mac[WinKey] = MacKey;
|
||||
}
|
||||
|
||||
bool InitWinKey2Mac(void)
|
||||
{
|
||||
memset(WinKey2Mac, MKC_None, sizeof(WinKey2Mac));
|
||||
|
||||
AssignOneMacKey('A', MKC_A);
|
||||
AssignOneMacKey('S', MKC_S);
|
||||
AssignOneMacKey('D', MKC_D);
|
||||
AssignOneMacKey('F', MKC_F);
|
||||
AssignOneMacKey('H', MKC_H);
|
||||
AssignOneMacKey('G', MKC_G);
|
||||
AssignOneMacKey('Z', MKC_Z);
|
||||
AssignOneMacKey('X', MKC_X);
|
||||
AssignOneMacKey('C', MKC_C);
|
||||
AssignOneMacKey('V', MKC_V);
|
||||
AssignOneMacKey('B', MKC_B);
|
||||
AssignOneMacKey('Q', MKC_Q);
|
||||
AssignOneMacKey('W', MKC_W);
|
||||
AssignOneMacKey('E', MKC_E);
|
||||
AssignOneMacKey('R', MKC_R);
|
||||
AssignOneMacKey('Y', MKC_Y);
|
||||
AssignOneMacKey('T', MKC_T);
|
||||
AssignOneMacKey('1', MKC_1);
|
||||
AssignOneMacKey('2', MKC_2);
|
||||
AssignOneMacKey('3', MKC_3);
|
||||
AssignOneMacKey('4', MKC_4);
|
||||
AssignOneMacKey('6', MKC_6);
|
||||
AssignOneMacKey('5', MKC_5);
|
||||
AssignOneMacKey(myVK_Equal, MKC_Equal);
|
||||
AssignOneMacKey('9', MKC_9);
|
||||
AssignOneMacKey('7', MKC_7);
|
||||
AssignOneMacKey(myVK_Subtract, MKC_Minus);
|
||||
AssignOneMacKey('8', MKC_8);
|
||||
AssignOneMacKey('0', MKC_0);
|
||||
AssignOneMacKey(myVK_RightBracket, MKC_RightBracket);
|
||||
AssignOneMacKey('O', MKC_O);
|
||||
AssignOneMacKey('U', MKC_U);
|
||||
AssignOneMacKey(myVK_LeftBracket, MKC_LeftBracket);
|
||||
AssignOneMacKey('I', MKC_I);
|
||||
AssignOneMacKey('P', MKC_P);
|
||||
AssignOneMacKey(VK_RETURN, MKC_Return);
|
||||
AssignOneMacKey('L', MKC_L);
|
||||
AssignOneMacKey('J', MKC_J);
|
||||
AssignOneMacKey(myVK_SingleQuote, MKC_SingleQuote);
|
||||
AssignOneMacKey('K', MKC_K);
|
||||
AssignOneMacKey(myVK_SemiColon, MKC_SemiColon);
|
||||
AssignOneMacKey(myVK_BackSlash, MKC_formac_BackSlash);
|
||||
AssignOneMacKey(myVK_Comma, MKC_Comma);
|
||||
AssignOneMacKey(myVK_Slash, MKC_formac_Slash);
|
||||
AssignOneMacKey('N', MKC_N);
|
||||
AssignOneMacKey('M', MKC_M);
|
||||
AssignOneMacKey(myVK_Period, MKC_Period);
|
||||
|
||||
AssignOneMacKey(VK_TAB, MKC_Tab);
|
||||
AssignOneMacKey(VK_SPACE, MKC_Space);
|
||||
AssignOneMacKey(myVK_Grave, MKC_formac_Grave);
|
||||
AssignOneMacKey(VK_BACK, MKC_BackSpace);
|
||||
AssignOneMacKey(VK_ESCAPE, MKC_formac_Escape);
|
||||
|
||||
AssignOneMacKey(VK_MENU, MKC_formac_Command);
|
||||
|
||||
AssignOneMacKey(VK_LMENU, MKC_formac_Command);
|
||||
|
||||
AssignOneMacKey(VK_RMENU, MKC_formac_RCommand);
|
||||
|
||||
AssignOneMacKey(VK_SHIFT, MKC_formac_Shift);
|
||||
AssignOneMacKey(VK_LSHIFT, MKC_formac_Shift);
|
||||
AssignOneMacKey(VK_RSHIFT, MKC_formac_RShift);
|
||||
|
||||
AssignOneMacKey(VK_CAPITAL, MKC_formac_CapsLock);
|
||||
|
||||
AssignOneMacKey(VK_APPS, MKC_formac_ROption);
|
||||
AssignOneMacKey(VK_LWIN, MKC_formac_Option);
|
||||
AssignOneMacKey(VK_RWIN, MKC_formac_ROption);
|
||||
AssignOneMacKey(VK_CONTROL, MKC_formac_Control);
|
||||
AssignOneMacKey(VK_LCONTROL, MKC_formac_Control);
|
||||
AssignOneMacKey(VK_RCONTROL, MKC_formac_RControl);
|
||||
|
||||
AssignOneMacKey(VK_F1, MKC_formac_F1);
|
||||
AssignOneMacKey(VK_F2, MKC_formac_F2);
|
||||
AssignOneMacKey(VK_F3, MKC_formac_F3);
|
||||
AssignOneMacKey(VK_F4, MKC_formac_F4);
|
||||
AssignOneMacKey(VK_F5, MKC_formac_F5);
|
||||
AssignOneMacKey(VK_F6, MKC_F6);
|
||||
AssignOneMacKey(VK_F7, MKC_F7);
|
||||
AssignOneMacKey(VK_F8, MKC_F8);
|
||||
AssignOneMacKey(VK_F9, MKC_F9);
|
||||
AssignOneMacKey(VK_F10, MKC_F10);
|
||||
AssignOneMacKey(VK_F11, MKC_F11);
|
||||
AssignOneMacKey(VK_F12, MKC_F12);
|
||||
|
||||
AssignOneMacKey(VK_DECIMAL, MKC_Decimal);
|
||||
AssignOneMacKey(VK_DELETE, MKC_Decimal);
|
||||
/* AssignOneMacKey(VK_RIGHT, 0x42); */
|
||||
AssignOneMacKey(VK_MULTIPLY, MKC_KPMultiply);
|
||||
AssignOneMacKey(VK_ADD, MKC_KPAdd);
|
||||
/* AssignOneMacKey(VK_LEFT, 0x46); */
|
||||
AssignOneMacKey(VK_NUMLOCK, MKC_Clear);
|
||||
|
||||
/* AssignOneMacKey(VK_DOWN, 0x48); */
|
||||
AssignOneMacKey(VK_DIVIDE, MKC_KPDevide);
|
||||
/* AssignOneMacKey(VK_RETURN, MKC_formac_Enter); */
|
||||
/* AssignOneMacKey(VK_UP, 0x4D); */
|
||||
AssignOneMacKey(VK_DIVIDE, MKC_KPDevide);
|
||||
AssignOneMacKey(VK_SUBTRACT, MKC_KPSubtract);
|
||||
|
||||
AssignOneMacKey(VK_SEPARATOR, MKC_KPEqual);
|
||||
AssignOneMacKey(VK_NUMPAD0, MKC_KP0);
|
||||
AssignOneMacKey(VK_NUMPAD1, MKC_KP1);
|
||||
AssignOneMacKey(VK_NUMPAD2, MKC_KP2);
|
||||
AssignOneMacKey(VK_NUMPAD3, MKC_KP3);
|
||||
AssignOneMacKey(VK_NUMPAD4, MKC_KP4);
|
||||
AssignOneMacKey(VK_NUMPAD5, MKC_KP5);
|
||||
|
||||
AssignOneMacKey(VK_NUMPAD6, MKC_KP6);
|
||||
AssignOneMacKey(VK_NUMPAD7, MKC_KP7);
|
||||
AssignOneMacKey(VK_NUMPAD8, MKC_KP8);
|
||||
AssignOneMacKey(VK_NUMPAD9, MKC_KP9);
|
||||
|
||||
AssignOneMacKey(VK_LEFT, MKC_Left);
|
||||
AssignOneMacKey(VK_RIGHT, MKC_Right);
|
||||
AssignOneMacKey(VK_DOWN, MKC_Down);
|
||||
AssignOneMacKey(VK_UP, MKC_Up);
|
||||
|
||||
AssignOneMacKey(myVK_PRIOR, MKC_formac_PageUp);
|
||||
AssignOneMacKey(myVK_NEXT, MKC_formac_PageDown);
|
||||
AssignOneMacKey(myVK_END, MKC_formac_End);
|
||||
AssignOneMacKey(myVK_HOME, MKC_formac_Home);
|
||||
AssignOneMacKey(myVK_INSERT, MKC_formac_Help);
|
||||
AssignOneMacKey(myVK_DELETE, MKC_formac_ForwardDel);
|
||||
AssignOneMacKey(myVK_HELP, MKC_formac_Help);
|
||||
AssignOneMacKey(myVK_SNAPSHOT, MKC_Print);
|
||||
AssignOneMacKey(myVK_SCROLL, MKC_ScrollLock);
|
||||
AssignOneMacKey(myVK_PAUSE, MKC_Pause);
|
||||
|
||||
AssignOneMacKey(myVK_OEM_102, MKC_AngleBracket);
|
||||
|
||||
InitKeyCodes();
|
||||
|
||||
#if ItnlKyBdFix
|
||||
InitCheckKeyboardLayout();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
LOCALPROC DoKeyCode(int i, bool down)
|
||||
{
|
||||
uint8_t key = WinKey2Mac[ItnlKyBdFix ? VkMapA[i] : i];
|
||||
if (MKC_None != key) {
|
||||
Keyboard_UpdateKeyMap2(key, down);
|
||||
}
|
||||
}
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
LOCALVAR bool HaveSetSysParam = false;
|
||||
#endif
|
||||
|
||||
LOCALPROC CheckTheCapsLock(void)
|
||||
{
|
||||
DoKeyCode(VK_CAPITAL, (GetKeyState(VK_CAPITAL) & 1) != 0);
|
||||
}
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
LOCALVAR bool VK_LWIN_pressed = false;
|
||||
LOCALVAR bool VK_RWIN_pressed = false;
|
||||
|
||||
void CheckForLostKeyUps(void)
|
||||
{
|
||||
if (HaveSetSysParam) {
|
||||
/* check for lost key ups */
|
||||
if (VK_LWIN_pressed) {
|
||||
if ((GetAsyncKeyState(VK_LWIN) & 0x8000) == 0) {
|
||||
DoKeyCode(VK_LWIN, false);
|
||||
VK_LWIN_pressed = false;
|
||||
}
|
||||
}
|
||||
if (VK_RWIN_pressed) {
|
||||
if ((GetAsyncKeyState(VK_RWIN) & 0x8000) == 0) {
|
||||
DoKeyCode(VK_RWIN, false);
|
||||
VK_RWIN_pressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC DoVKcode0(int i, bool down)
|
||||
{
|
||||
#if EnableGrabSpecialKeys
|
||||
if (HaveSetSysParam) {
|
||||
/* will need to check for lost key ups */
|
||||
if (VK_LWIN == i) {
|
||||
VK_LWIN_pressed = down;
|
||||
} else if (VK_RWIN == i) {
|
||||
VK_RWIN_pressed = down;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DoKeyCode(i, down);
|
||||
}
|
||||
|
||||
void DoVKcode(int i, uint8_t flags, bool down)
|
||||
{
|
||||
switch (i) {
|
||||
#if MKC_formac_Control != MKC_formac_RControl
|
||||
case VK_CONTROL:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_RControl : MKC_formac_Control,
|
||||
down);
|
||||
break;
|
||||
#endif
|
||||
#if MKC_formac_RCommand != MKC_formac_Command
|
||||
case VK_MENU:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_RCommand : MKC_formac_Command,
|
||||
down);
|
||||
break;
|
||||
#endif
|
||||
case VK_RETURN:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_Enter : MKC_Return,
|
||||
down);
|
||||
break;
|
||||
case myVK_HOME:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_Home : MKC_KP7,
|
||||
down);
|
||||
break;
|
||||
case VK_UP:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_Up : MKC_KP8,
|
||||
down);
|
||||
break;
|
||||
case myVK_PRIOR:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_PageUp : MKC_KP9,
|
||||
down);
|
||||
break;
|
||||
case VK_LEFT:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_Left : MKC_KP4,
|
||||
down);
|
||||
break;
|
||||
case myVK_CLEAR:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_Clear : MKC_KP5,
|
||||
down);
|
||||
break;
|
||||
case VK_RIGHT:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_Right : MKC_KP6,
|
||||
down);
|
||||
break;
|
||||
case myVK_END:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_End : MKC_KP1,
|
||||
down);
|
||||
break;
|
||||
case VK_DOWN:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_Down : MKC_KP2,
|
||||
down);
|
||||
break;
|
||||
case myVK_NEXT:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_PageDown : MKC_KP3,
|
||||
down);
|
||||
break;
|
||||
case myVK_INSERT:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_Help : MKC_KP0,
|
||||
down);
|
||||
break;
|
||||
case myVK_DELETE:
|
||||
Keyboard_UpdateKeyMap2(TestBit(flags, 0)
|
||||
? MKC_formac_ForwardDel : MKC_Decimal,
|
||||
down);
|
||||
break;
|
||||
case VK_CAPITAL:
|
||||
CheckTheCapsLock();
|
||||
break;
|
||||
default:
|
||||
if ((i >= 0) && (i < 256)) {
|
||||
DoVKcode0(i, down);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool WantCmdOptOnReconnect = false;
|
||||
|
||||
void ReconnectKeyCodes3(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
CheckTheCapsLock();
|
||||
|
||||
if (WantCmdOptOnReconnect) {
|
||||
WantCmdOptOnReconnect = false;
|
||||
|
||||
for (i = 0; i < 256; ++i) {
|
||||
if ((GetKeyState(i) & 0x8000) != 0) {
|
||||
if ((VK_CAPITAL != i)
|
||||
&& (VK_RETURN != i))
|
||||
{
|
||||
DoVKcode0(i, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DisconnectKeyCodes3(void)
|
||||
{
|
||||
DisconnectKeyCodes2();
|
||||
SetCurMouseButton(false);
|
||||
}
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
static HHOOK hKeyHook = NULL;
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
typedef struct {
|
||||
DWORD vkCode;
|
||||
DWORD scanCode;
|
||||
DWORD flags;
|
||||
DWORD time;
|
||||
DWORD dwExtraInfo;
|
||||
} _KBDLLHOOKSTRUCT;
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
LRESULT CALLBACK LowLevelKeyboardProc(
|
||||
int nCode, /* hook code */
|
||||
WPARAM wParam, /* message identifier */
|
||||
LPARAM lParam /* pointer to structure with message data */
|
||||
);
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
LRESULT CALLBACK LowLevelKeyboardProc(
|
||||
int nCode, /* hook code */
|
||||
WPARAM wParam, /* message identifier */
|
||||
LPARAM lParam /* pointer to structure with message data */
|
||||
)
|
||||
{
|
||||
if (nCode == HC_ACTION) {
|
||||
_KBDLLHOOKSTRUCT *p = (_KBDLLHOOKSTRUCT *)lParam;
|
||||
if (p->vkCode != VK_CAPITAL) {
|
||||
switch (wParam) {
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
DoVKcode(p->vkCode, p->flags, true);
|
||||
return 1;
|
||||
break;
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
DoVKcode(p->vkCode, p->flags, false);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(hKeyHook, /* handle to current hook */
|
||||
nCode, /* hook code passed to hook procedure */
|
||||
wParam, /* value passed to hook procedure */
|
||||
lParam /* value passed to hook procedure */
|
||||
);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
#define _WH_KEYBOARD_LL 13
|
||||
#define _SPI_SETSCREENSAVERRUNNING 0x0061
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
LOCALVAR UINT nPreviousState;
|
||||
#endif
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
void GrabSpecialKeys(void)
|
||||
{
|
||||
if ((hKeyHook == NULL) && ! HaveSetSysParam) {
|
||||
/* this works on Windows XP */
|
||||
hKeyHook = SetWindowsHookEx(
|
||||
_WH_KEYBOARD_LL, /* type of hook to install */
|
||||
(HOOKPROC)LowLevelKeyboardProc,
|
||||
/* address of hook procedure */
|
||||
AppInstance, /* handle to application instance */
|
||||
0 /* identity of thread to install hook for */
|
||||
);
|
||||
if (hKeyHook == NULL) {
|
||||
/* this works on Windows 95/98 */
|
||||
SystemParametersInfo(_SPI_SETSCREENSAVERRUNNING, TRUE,
|
||||
&nPreviousState, 0);
|
||||
HaveSetSysParam = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UnGrabSpecialKeys(void)
|
||||
{
|
||||
if (hKeyHook != NULL) {
|
||||
(void) UnhookWindowsHookEx(hKeyHook);
|
||||
hKeyHook = NULL;
|
||||
}
|
||||
if (HaveSetSysParam) {
|
||||
SystemParametersInfo(_SPI_SETSCREENSAVERRUNNING, FALSE,
|
||||
&nPreviousState, 0);
|
||||
HaveSetSysParam = false;
|
||||
}
|
||||
}
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,150 +0,0 @@
|
||||
#ifndef OSGLUWIN_H
|
||||
#define OSGLUWIN_H
|
||||
|
||||
#include "SYSDEPNS.h"
|
||||
#include "CNFGRAPI.h"
|
||||
#include "CNFGGLOB.h"
|
||||
#include "UI/COMOSGLU.h"
|
||||
#include "UI/CONTROLM.h"
|
||||
#include "UI/WIN32/SOUND.h"
|
||||
|
||||
/* Define the undefined */
|
||||
|
||||
#ifndef ItnlKyBdFix
|
||||
#define ItnlKyBdFix 0
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE
|
||||
#define UseUni 1
|
||||
#else
|
||||
#define UseUni 0
|
||||
#endif
|
||||
|
||||
#ifndef InstallFileIcons
|
||||
#define InstallFileIcons 0
|
||||
#endif
|
||||
|
||||
#ifndef EnableGrabSpecialKeys
|
||||
#define EnableGrabSpecialKeys (MayFullScreen && GrabKeysFullScreen)
|
||||
#endif /* EnableGrabSpecialKeys */
|
||||
|
||||
/* Resource Ids */
|
||||
|
||||
#define IDI_VMAC 256
|
||||
#if InstallFileIcons
|
||||
#define IDI_ROM 257
|
||||
#define IDI_DISK 258
|
||||
#endif
|
||||
|
||||
/* API differences */
|
||||
|
||||
bool GetAppDir(LPTSTR pathName);
|
||||
|
||||
/* Utilities (move?) */
|
||||
|
||||
#define TestBit(i, p) (((unsigned long)(i) & PowOf2(p)) != 0)
|
||||
|
||||
/* Parameter buffers */
|
||||
|
||||
#if IncludePbufs
|
||||
#define PbufHaveLock 1
|
||||
HGLOBAL PbufDat[NumPbufs];
|
||||
#endif
|
||||
|
||||
/* Main window info */
|
||||
|
||||
extern HWND MainWnd;
|
||||
HINSTANCE AppInstance;
|
||||
int WndX;
|
||||
int WndY;
|
||||
extern bool UseFullScreen;
|
||||
extern bool UseMagnify;
|
||||
|
||||
#if MayFullScreen
|
||||
short hOffset;
|
||||
short vOffset;
|
||||
#endif
|
||||
|
||||
void ToggleWantFullScreen(void);
|
||||
|
||||
/* cursor */
|
||||
|
||||
extern bool HaveCursorHidden;
|
||||
extern bool WantCursorHidden;
|
||||
extern bool MouseCaptured;
|
||||
|
||||
void SetCurMouseButton(bool v);
|
||||
|
||||
/* Keyboard */
|
||||
|
||||
#ifdef ItnlKyBdFix
|
||||
uint8_t VkMapA[256];
|
||||
void InitCheckKeyboardLayout(void);
|
||||
void CheckKeyboardLayout(void);
|
||||
#endif
|
||||
|
||||
/* these constants weren't in the header files I have */
|
||||
#define myVK_Subtract 0xBD
|
||||
#define myVK_Equal 0xBB
|
||||
#define myVK_BackSlash 0xDC
|
||||
#define myVK_Comma 0xBC
|
||||
#define myVK_Period 0xBE
|
||||
#define myVK_Slash 0xBF
|
||||
#define myVK_SemiColon 0xBA
|
||||
#define myVK_SingleQuote 0xDE
|
||||
#define myVK_LeftBracket 0xDB
|
||||
#define myVK_RightBracket 0xDD
|
||||
#define myVK_Grave 0xC0
|
||||
|
||||
/* some new ones, need to check if in all header versions */
|
||||
#define myVK_PRIOR 0x21
|
||||
#define myVK_NEXT 0x22
|
||||
#define myVK_END 0x23
|
||||
#define myVK_HOME 0x24
|
||||
#define myVK_INSERT 0x2D
|
||||
#define myVK_DELETE 0x2E
|
||||
#define myVK_HELP 0x2F
|
||||
#define myVK_SCROLL 0x91
|
||||
#define myVK_SNAPSHOT 0x2C
|
||||
#define myVK_PAUSE 0x13
|
||||
#define myVK_CLEAR 0x0C
|
||||
|
||||
#define myVK_OEM_8 0xDF
|
||||
#define myVK_OEM_102 0xE2
|
||||
|
||||
extern bool WantCmdOptOnReconnect;
|
||||
|
||||
void DoVKcode(int i, uint8_t flags, bool down);
|
||||
void DisconnectKeyCodes3(void);
|
||||
void ReconnectKeyCodes3(void);
|
||||
bool InitWinKey2Mac(void);
|
||||
|
||||
#if EnableGrabSpecialKeys
|
||||
void GrabSpecialKeys(void);
|
||||
void UnGrabSpecialKeys(void);
|
||||
void CheckForLostKeyUps(void);
|
||||
#endif
|
||||
|
||||
/* --- time, date, location --- */
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
extern uint32_t TrueEmulatedTime;
|
||||
|
||||
#define InvTimeDivPow 16
|
||||
#define InvTimeDiv (1 << InvTimeDivPow)
|
||||
#define InvTimeDivMask (InvTimeDiv - 1)
|
||||
#define InvTimeStep 1089590 /* 1000 / 60.14742 * InvTimeDiv */
|
||||
|
||||
DWORD LastTime;
|
||||
DWORD NextIntTime;
|
||||
|
||||
void IncrNextTime(void);
|
||||
void InitNextTime(void);
|
||||
bool UpdateTrueEmulatedTime(void);
|
||||
bool CheckDateTime(void);
|
||||
bool Init60thCheck(void);
|
||||
void Timer_Suspend(void);
|
||||
void Timer_Resume(void);
|
||||
|
||||
#endif // OSGLUWIN_H
|
@ -1,292 +0,0 @@
|
||||
/* --- sound --- */
|
||||
|
||||
#include "OSGLUWIN.h"
|
||||
|
||||
#if SoundEnabled
|
||||
#include "UI/WIN32/SOUND.h"
|
||||
tpSoundSamp TheSoundBuffer = nullpr;
|
||||
HWAVEOUT hWaveOut = NULL;
|
||||
|
||||
void FillWithSilence(tpSoundSamp p, int n, trSoundSamp v)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = n; --i >= 0; ) {
|
||||
*p++ = v;
|
||||
}
|
||||
}
|
||||
|
||||
void Sound_BeginPlaying(void)
|
||||
{
|
||||
#if dbglog_SoundStuff
|
||||
fprintf(stderr, "Sound_BeginPlaying\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void Sound_Start(void)
|
||||
{
|
||||
if (hWaveOut == NULL) {
|
||||
WAVEFORMATEX wfex;
|
||||
MMRESULT mmr;
|
||||
int i;
|
||||
tpSoundSamp p;
|
||||
WAVEHDR *pwh;
|
||||
|
||||
wfex.wFormatTag = WAVE_FORMAT_PCM;
|
||||
wfex.nChannels = 1;
|
||||
wfex.nSamplesPerSec = SOUND_SAMPLERATE;
|
||||
wfex.nAvgBytesPerSec = SOUND_SAMPLERATE;
|
||||
#if 3 == kLn2SoundSampSz
|
||||
wfex.nBlockAlign = 1;
|
||||
wfex.wBitsPerSample = 8;
|
||||
#elif 4 == kLn2SoundSampSz
|
||||
wfex.nBlockAlign = 2;
|
||||
wfex.wBitsPerSample = 16;
|
||||
#else
|
||||
#error "unsupported audio format"
|
||||
#endif
|
||||
wfex.cbSize = 0;
|
||||
mmr = waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfex, 0,
|
||||
0 /* (DWORD) AppInstance */, CALLBACK_NULL);
|
||||
if (mmr != MMSYSERR_NOERROR) {
|
||||
/*
|
||||
not recursive:
|
||||
MacMsg("waveOutOpen failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
} else {
|
||||
p = TheSoundBuffer;
|
||||
pwh = whdr;
|
||||
for (i = 0; i < kSoundBuffers; ++i) {
|
||||
pwh->lpData = (LPSTR)p;
|
||||
pwh->dwBufferLength = kOneBuffSz;
|
||||
pwh->dwBytesRecorded = 0;
|
||||
pwh->dwUser = 0;
|
||||
pwh->dwFlags = 0;
|
||||
pwh->dwLoops = 0;
|
||||
mmr = waveOutPrepareHeader(hWaveOut, pwh,
|
||||
sizeof(WAVEHDR));
|
||||
if (mmr != MMSYSERR_NOERROR) {
|
||||
/*
|
||||
not recursive:
|
||||
MacMsg("waveOutPrepareHeader failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
} else {
|
||||
pwh->dwFlags |= WHDR_DONE;
|
||||
}
|
||||
p += kOneBuffLen;
|
||||
++pwh;
|
||||
}
|
||||
|
||||
TheFillOffset = 0;
|
||||
ThePlayOffset = 0;
|
||||
TheWriteOffset = 0;
|
||||
MinFilledSoundBuffs = kSoundBuffers;
|
||||
wantplaying = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Sound_Stop(void)
|
||||
{
|
||||
MMRESULT mmr;
|
||||
int i;
|
||||
|
||||
wantplaying = false;
|
||||
if (hWaveOut != NULL) {
|
||||
DWORD StartTime = GetTickCount();
|
||||
for (i = 0; i < kSoundBuffers; ++i) {
|
||||
while (((whdr[i].dwFlags & WHDR_DONE) == 0)
|
||||
&& ((uint32_t)(GetTickCount() - StartTime) < 1000))
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
mmr = waveOutUnprepareHeader(hWaveOut, &whdr[i],
|
||||
sizeof(WAVEHDR));
|
||||
if (mmr != MMSYSERR_NOERROR) {
|
||||
/*
|
||||
not recursive:
|
||||
MacMsg("waveOutUnprepareHeader failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
mmr = waveOutClose(hWaveOut);
|
||||
if (mmr != MMSYSERR_NOERROR) {
|
||||
/*
|
||||
MacMsg("waveOutClose failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
}
|
||||
hWaveOut = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void SoundCheckVeryOften(void)
|
||||
{
|
||||
if ((hWaveOut != NULL) && (wantplaying)) {
|
||||
label_retry:
|
||||
{
|
||||
uint16_t FilledSoundBuffs;
|
||||
uint16_t ToPlaySize = TheFillOffset - ThePlayOffset;
|
||||
uint16_t CurPlayBuffer =
|
||||
(ThePlayOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
|
||||
if ((ToPlaySize > kOneBuffLen)
|
||||
&& ((whdr[CurPlayBuffer].dwFlags & WHDR_DONE) != 0))
|
||||
{
|
||||
ThePlayOffset += kOneBuffLen;
|
||||
goto label_retry;
|
||||
}
|
||||
FilledSoundBuffs = ToPlaySize >> kLnOneBuffLen;
|
||||
|
||||
if (FilledSoundBuffs < MinFilledSoundBuffs) {
|
||||
MinFilledSoundBuffs = FilledSoundBuffs;
|
||||
}
|
||||
|
||||
if (FilledSoundBuffs < 2) {
|
||||
MMRESULT mmr;
|
||||
uint16_t PrevPlayOffset = ThePlayOffset - kOneBuffLen;
|
||||
uint16_t PrevPlayBuffer =
|
||||
(PrevPlayOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
uint16_t LastPlayedOffset =
|
||||
((TheFillOffset >> kLnOneBuffLen) << kLnOneBuffLen)
|
||||
- 1;
|
||||
|
||||
FillWithSilence(
|
||||
TheSoundBuffer + (PrevPlayOffset & kAllBuffMask),
|
||||
kOneBuffLen,
|
||||
*(TheSoundBuffer
|
||||
+ (LastPlayedOffset & kAllBuffMask)));
|
||||
mmr = waveOutWrite(
|
||||
hWaveOut, &whdr[PrevPlayBuffer], sizeof(WAVEHDR));
|
||||
if (mmr != MMSYSERR_NOERROR) {
|
||||
whdr[PrevPlayBuffer].dwFlags |= WHDR_DONE;
|
||||
/*
|
||||
not recursive:
|
||||
MacMsg("waveOutWrite failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
}
|
||||
ThePlayOffset = PrevPlayOffset;
|
||||
goto label_retry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 4 == kLn2SoundSampSz
|
||||
void ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = kOneBuffLen; --i >= 0; ) {
|
||||
*p++ -= 0x8000;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define ConvertSoundBlockToNative(p)
|
||||
#endif
|
||||
|
||||
void Sound_FilledBlocks(void)
|
||||
{
|
||||
while (0 != ((TheWriteOffset - TheFillOffset) >> kLnOneBuffLen)) {
|
||||
uint16_t CurFillBuffer =
|
||||
(TheFillOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
bool IsOk = false;
|
||||
|
||||
ConvertSoundBlockToNative((tpSoundSamp)
|
||||
whdr[CurFillBuffer].lpData);
|
||||
|
||||
if (hWaveOut != NULL) {
|
||||
MMRESULT mmr = waveOutWrite(hWaveOut,
|
||||
&whdr[CurFillBuffer], sizeof(WAVEHDR));
|
||||
if (mmr == MMSYSERR_NOERROR) {
|
||||
IsOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! IsOk) {
|
||||
/*
|
||||
not recursive:
|
||||
MacMsg("waveOutWrite failed",
|
||||
"Sorry, Mini vMac encountered errors"
|
||||
" and cannot continue.", true);
|
||||
*/
|
||||
whdr[CurFillBuffer].dwFlags |= WHDR_DONE;
|
||||
}
|
||||
|
||||
TheFillOffset += kOneBuffLen;
|
||||
}
|
||||
}
|
||||
|
||||
void Sound_WroteABlock(void)
|
||||
{
|
||||
if (wantplaying) {
|
||||
Sound_FilledBlocks();
|
||||
} else if (((TheWriteOffset - ThePlayOffset) >> kLnOneBuffLen) < 12)
|
||||
{
|
||||
/* just wait */
|
||||
} else {
|
||||
Sound_FilledBlocks();
|
||||
wantplaying = true;
|
||||
Sound_BeginPlaying();
|
||||
}
|
||||
}
|
||||
|
||||
void Sound_EndWrite(uint16_t actL)
|
||||
{
|
||||
TheWriteOffset += actL;
|
||||
|
||||
if (0 == (TheWriteOffset & kOneBuffMask)) {
|
||||
/* just finished a block */
|
||||
|
||||
Sound_WroteABlock();
|
||||
}
|
||||
}
|
||||
|
||||
tpSoundSamp Sound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
n = WriteBuffContig;
|
||||
}
|
||||
if (ToFillLen < n) {
|
||||
/* overwrite previous buffer */
|
||||
TheWriteOffset -= kOneBuffLen;
|
||||
}
|
||||
|
||||
*actL = n;
|
||||
return TheSoundBuffer + (TheWriteOffset & kAllBuffMask);
|
||||
}
|
||||
|
||||
void Sound_SecondNotify(void)
|
||||
{
|
||||
if (hWaveOut != NULL) {
|
||||
if (MinFilledSoundBuffs > DesiredMinFilledSoundBuffs) {
|
||||
#if dbglog_SoundStuff
|
||||
dbglog_writeln("MinFilledSoundBuffs too high");
|
||||
#endif
|
||||
IncrNextTime();
|
||||
} else if (MinFilledSoundBuffs < DesiredMinFilledSoundBuffs) {
|
||||
#if dbglog_SoundStuff
|
||||
dbglog_writeln("MinFilledSoundBuffs too low");
|
||||
#endif
|
||||
++TrueEmulatedTime;
|
||||
}
|
||||
MinFilledSoundBuffs = kSoundBuffers;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,56 +0,0 @@
|
||||
#ifndef WIN32_SOUND_H
|
||||
#define WIN32_SOUND_H
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define kLn2SoundBuffers 4 /* kSoundBuffers must be a power of two */
|
||||
#define kSoundBuffers (1 << kLn2SoundBuffers)
|
||||
#define kSoundBuffMask (kSoundBuffers - 1)
|
||||
|
||||
#define DesiredMinFilledSoundBuffs 3
|
||||
/*
|
||||
if too big then sound lags behind emulation.
|
||||
if too small then sound will have pauses.
|
||||
*/
|
||||
|
||||
#define kLnOneBuffLen 9
|
||||
#define kLnAllBuffLen (kLn2SoundBuffers + kLnOneBuffLen)
|
||||
#define kOneBuffLen (1UL << kLnOneBuffLen)
|
||||
#define kAllBuffLen (1UL << kLnAllBuffLen)
|
||||
#define kLnOneBuffSz (kLnOneBuffLen + kLn2SoundSampSz - 3)
|
||||
#define kLnAllBuffSz (kLnAllBuffLen + kLn2SoundSampSz - 3)
|
||||
#define kOneBuffSz (1UL << kLnOneBuffSz)
|
||||
#define kAllBuffSz (1UL << kLnAllBuffSz)
|
||||
#define kOneBuffMask (kOneBuffLen - 1)
|
||||
#define kAllBuffMask (kAllBuffLen - 1)
|
||||
#define dbhBufferSize (kAllBuffSz + kOneBuffSz)
|
||||
|
||||
#define dbglog_SoundStuff (0 && dbglog_HAVE)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
extern tpSoundSamp TheSoundBuffer;
|
||||
uint16_t ThePlayOffset;
|
||||
uint16_t TheFillOffset;
|
||||
bool wantplaying;
|
||||
uint16_t MinFilledSoundBuffs;
|
||||
uint16_t TheWriteOffset;
|
||||
|
||||
extern HWAVEOUT hWaveOut;
|
||||
WAVEHDR whdr[kSoundBuffers];
|
||||
|
||||
#define SOUND_SAMPLERATE /* 22050 */ 22255
|
||||
/* = round(7833600 * 2 / 704) */
|
||||
|
||||
void FillWithSilence(tpSoundSamp p, int n, trSoundSamp v);
|
||||
void Sound_BeginPlaying(void);
|
||||
void Sound_Start(void);
|
||||
void Sound_Stop(void);
|
||||
void SoundCheckVeryOften(void);
|
||||
void ConvertSoundBlockToNative(tpSoundSamp p);
|
||||
void Sound_FilledBlocks(void);
|
||||
void Sound_WroteABlock(void);
|
||||
void Sound_EndWrite(uint16_t actL);
|
||||
tpSoundSamp Sound_BeginWrite(uint16_t n, uint16_t *actL);
|
||||
void Sound_SecondNotify(void);
|
||||
|
||||
#endif
|
@ -1,167 +0,0 @@
|
||||
#include "OSGLUWIN.h"
|
||||
|
||||
/* --- time, date, location --- */
|
||||
|
||||
uint32_t TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TimeSecBase;
|
||||
LOCALVAR DWORD TimeMilliBase;
|
||||
LOCALVAR uint32_t NextFracTime;
|
||||
bool HaveSetTimeResolution = false;
|
||||
|
||||
// API wrapper defines
|
||||
|
||||
/*
|
||||
Timer resolution, as used by timeBeginPeriod(), in milliseconds.
|
||||
Setting TimeResolution to 1 seems to drastically slow down
|
||||
the clock in Virtual PC 7.0.2 for Mac. Using 3 is more polite
|
||||
anyway, and should not cause much observable difference.
|
||||
(note that 1/60 of a frame is 16.7 milliseconds)
|
||||
*/
|
||||
#ifndef TimeResolution
|
||||
#define TimeResolution 3
|
||||
#endif
|
||||
/*
|
||||
Windows NT: The default precision of the timeGetTime function can be five
|
||||
milliseconds or more, depending on the machine. You can use the
|
||||
timeBeginPeriod and timeEndPeriod functions to increase the precision of
|
||||
timeGetTime. If you do so, the minimum difference between successive values
|
||||
returned by timeGetTime can be as large as the minimum period value set using
|
||||
timeBeginPeriod and timeEndPeriod. Use the QueryPerformanceCounter and
|
||||
QueryPerformanceFrequency functions to measure short time intervals at a high
|
||||
resolution. (MSDN for Visual Studio '97)
|
||||
(TODO: use QueryPerformanceCounter instead? Always works on WinXP+)
|
||||
*/
|
||||
#define GetTimeMillisec timeGetTime
|
||||
|
||||
void IncrNextTime(void)
|
||||
{
|
||||
NextFracTime += InvTimeStep;
|
||||
NextIntTime += (NextFracTime >> InvTimeDivPow);
|
||||
NextFracTime &= InvTimeDivMask;
|
||||
}
|
||||
|
||||
void InitNextTime(void)
|
||||
{
|
||||
NextIntTime = LastTime;
|
||||
NextFracTime = 0;
|
||||
IncrNextTime();
|
||||
}
|
||||
|
||||
bool UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
DWORD LatestTime;
|
||||
int32_t TimeDiff;
|
||||
|
||||
LatestTime = GetTimeMillisec();
|
||||
if (LatestTime != LastTime) {
|
||||
LastTime = LatestTime;
|
||||
TimeDiff = (LatestTime - NextIntTime);
|
||||
/* this should work even when time wraps */
|
||||
if (TimeDiff >= 0) {
|
||||
if (TimeDiff > 256) {
|
||||
/* emulation interrupted, forget it */
|
||||
++TrueEmulatedTime;
|
||||
InitNextTime();
|
||||
|
||||
#if dbglog_TimeStuff
|
||||
dbglog_writelnNum(
|
||||
"emulation interrupted",
|
||||
TrueEmulatedTime
|
||||
);
|
||||
#endif
|
||||
} else {
|
||||
do {
|
||||
++TrueEmulatedTime;
|
||||
IncrNextTime();
|
||||
TimeDiff = (LatestTime - NextIntTime);
|
||||
} while (TimeDiff >= 0);
|
||||
}
|
||||
return true;
|
||||
} else if (TimeDiff < -256) {
|
||||
/* clock goofed if ever get here, reset */
|
||||
#if dbglog_TimeStuff
|
||||
dbglog_writeln("clock set back");
|
||||
#endif
|
||||
|
||||
InitNextTime();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that emulated clock equals real clock
|
||||
bool CheckDateTime(void)
|
||||
{
|
||||
uint32_t NewMacDateInSecond;
|
||||
|
||||
NewMacDateInSecond =
|
||||
((uint32_t)(LastTime - TimeMilliBase)) / 1000 + TimeSecBase;
|
||||
if (CurMacDateInSeconds != NewMacDateInSecond) {
|
||||
CurMacDateInSeconds = NewMacDateInSecond;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize emulated RTC check
|
||||
bool Init60thCheck(void)
|
||||
{
|
||||
SYSTEMTIME s;
|
||||
TIME_ZONE_INFORMATION r;
|
||||
DWORD v;
|
||||
DWORD t;
|
||||
|
||||
GetLocalTime(&s);
|
||||
t = GetTimeMillisec();
|
||||
|
||||
TimeSecBase = Date2MacSeconds(
|
||||
s.wSecond, s.wMinute, s.wHour,
|
||||
s.wDay, s.wMonth, s.wYear
|
||||
);
|
||||
TimeMilliBase = t - s.wMilliseconds;
|
||||
|
||||
if (AutoTimeZone) {
|
||||
v = GetTimeZoneInformation(&r);
|
||||
if ((v != 0xFFFFFFFF) && (v != TIME_ZONE_ID_UNKNOWN)) {
|
||||
int32_t dlsBias = \
|
||||
(v != TIME_ZONE_ID_DAYLIGHT) ? r.StandardBias : r.DaylightBias;
|
||||
CurMacDelta = \
|
||||
(((uint32_t)(- (r.Bias + dlsBias) * 60)) & 0x00FFFFFF)
|
||||
| (((v != TIME_ZONE_ID_DAYLIGHT) ? 0 : 0x80) << 24 );
|
||||
}
|
||||
}
|
||||
|
||||
LastTime = GetTimeMillisec();
|
||||
InitNextTime();
|
||||
|
||||
OnTrueTime = TrueEmulatedTime;
|
||||
|
||||
(void) CheckDateTime();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Timer_Suspend(void)
|
||||
{
|
||||
// If using higher-precision timer, stop
|
||||
if (HaveSetTimeResolution) {
|
||||
(void) timeEndPeriod(TimeResolution);
|
||||
HaveSetTimeResolution = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Timer_Resume(void)
|
||||
{
|
||||
TIMECAPS tc;
|
||||
|
||||
// Try to use higher-precision timer
|
||||
if (
|
||||
timeGetDevCaps(&tc, sizeof(TIMECAPS)) == TIMERR_NOERROR &&
|
||||
(TimeResolution >= tc.wPeriodMin) &&
|
||||
(TimeResolution <= tc.wPeriodMax) &&
|
||||
timeBeginPeriod(TimeResolution) == TIMERR_NOERROR
|
||||
) {
|
||||
HaveSetTimeResolution = true;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user