Commit 4ecb44b1 authored by Sam Lantinga's avatar Sam Lantinga

Formatting update

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402120
parent d0a80f6b
......@@ -147,7 +147,8 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *
surface);
extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title,
const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title, const char **icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption(const char **title,
const char **icon);
extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask);
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface * surface);
......
......@@ -160,7 +160,7 @@ extern "C"
SDL_AudioFormat test_format = SDL_FirstAudioFormat(spec->format);
/* Parse the audio format and fill the Be raw audio format */
memset(&format, '\0', sizeof (media_raw_audio_format));
memset(&format, '\0', sizeof(media_raw_audio_format));
format.byte_order = B_MEDIA_LITTLE_ENDIAN;
format.frame_rate = (float) spec->freq;
format.channel_count = spec->channels; /* !!! FIXME: support > 2? */
......
......@@ -212,7 +212,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
int valid_datatype = 0;
/* Setup a AudioStreamBasicDescription with the requested format */
memset(&strdesc, '\0', sizeof (AudioStreamBasicDescription));
memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
strdesc.mFormatID = kAudioFormatLinearPCM;
strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
strdesc.mChannelsPerFrame = spec->channels;
......@@ -257,7 +257,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
/* Locate the default output audio unit */
memset(&desc, '\0', sizeof (ComponentDescription));
memset(&desc, '\0', sizeof(ComponentDescription));
desc.componentType = kAudioUnitComponentType;
desc.componentSubType = kAudioUnitSubType_Output;
desc.componentManufacturer = kAudioUnitID_DefaultOutput;
......@@ -280,8 +280,7 @@ Core_OpenAudio(_THIS, SDL_AudioSpec * spec)
result = AudioUnitSetProperty(outputAudioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&strdesc, sizeof (strdesc));
0, &strdesc, sizeof(strdesc));
CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
/* Set the audio callback */
callback.inputProc = audioCallback;
......
......@@ -146,7 +146,8 @@ SDL_MintAudio_SearchFrequency(_THIS, int desired_freq)
}
/* Check if FPU is present */
void SDL_MintAudio_CheckFpu(void)
void
SDL_MintAudio_CheckFpu(void)
{
unsigned long cookie_fpu;
......@@ -154,7 +155,7 @@ void SDL_MintAudio_CheckFpu(void)
if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
return;
}
switch ((cookie_fpu>>16)&0xfffe) {
switch ((cookie_fpu >> 16) & 0xfffe) {
case 2:
case 4:
case 6:
......
......@@ -218,7 +218,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i, masterprediv, sfreq;
unsigned long masterclock;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......@@ -274,7 +275,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......
......@@ -328,7 +328,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......
......@@ -225,7 +225,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i;
unsigned long masterclock, masterprediv;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......@@ -299,7 +300,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......
......@@ -206,7 +206,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
{
int i;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......@@ -239,7 +240,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......
......@@ -83,7 +83,7 @@ Audio_Available(void)
unsigned long dummy;
const char *envr = SDL_getenv("SDL_AUDIODRIVER");
/*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/
/*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND); */
SDL_MintAudio_mint_present = SDL_FALSE;
/* We can't use XBIOS in interrupt with Magic, don't know about thread */
......@@ -360,7 +360,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
int i;
Uint32 extclock;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......@@ -406,7 +407,8 @@ Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(spec->format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
......@@ -468,7 +470,7 @@ Mint_InitAudio(_THIS, SDL_AudioSpec * spec)
} else {
/* Install interrupt */
Jdisint(MFP_DMASOUND);
/*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);*/
/*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt); */
Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
Jenabint(MFP_DMASOUND);
......
......@@ -432,23 +432,31 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
int numjoypad, i;
numjoypad = 0;
switch(numjoystick) {
switch (numjoystick) {
case PORTA_PAD0:
numjoypad = 0; break;
numjoypad = 0;
break;
case PORTA_PAD1:
numjoypad = 1; break;
numjoypad = 1;
break;
case PORTA_PAD2:
numjoypad = 2; break;
numjoypad = 2;
break;
case PORTA_PAD3:
numjoypad = 3; break;
numjoypad = 3;
break;
case PORTB_PAD0:
numjoypad = 4; break;
numjoypad = 4;
break;
case PORTB_PAD1:
numjoypad = 5; break;
numjoypad = 5;
break;
case PORTB_PAD2:
numjoypad = 6; break;
numjoypad = 6;
break;
case PORTB_PAD3:
numjoypad = 7; break;
numjoypad = 7;
break;
}
curstate = jp_joypads[numjoypad];
......@@ -647,7 +655,7 @@ struct JOYPAD_IO_S
};
#define JOYPAD_IO ((*(volatile struct JOYPAD_IO_S *)JOYPAD_IO_BASE))
static const Uint16 joypad_masks[8*4]={
static const Uint16 joypad_masks[8 * 4] = {
0xfffe, 0xfffd, 0xfffb, 0xfff7,
0xfff0, 0xfff1, 0xfff2, 0xfff3,
0xfff4, 0xfff5, 0xfff6, 0xfff8,
......@@ -686,34 +694,34 @@ UpdateJoypads(void)
jp_paddles[3] = (tmp << 8) | tmp;
/* Update joypads on teamtap port A */
for (i=0; i<4; i++) {
for (i = 0; i < 4; i++) {
jp_joypads[i] = 0;
for (j=0; j<4; j++) {
JOYPAD_IO.directions = joypad_masks[(i*4)+j];
for (j = 0; j < 4; j++) {
JOYPAD_IO.directions = joypad_masks[(i * 4) + j];
cur_fire = (~(JOYPAD_IO.fires) & 3)<<16;
cur_dir = (~(JOYPAD_IO.directions)>>8) & 15;
cur_fire = (~(JOYPAD_IO.fires) & 3) << 16;
cur_dir = (~(JOYPAD_IO.directions) >> 8) & 15;
jp_joypads[i] |= cur_fire<<(j*2);
jp_joypads[i] |= cur_dir<<(j*4);
jp_joypads[i] |= cur_fire << (j * 2);
jp_joypads[i] |= cur_dir << (j * 4);
}
}
/* Update joypads on teamtap port B */
for (i=4; i<8; i++) {
for (i = 4; i < 8; i++) {
jp_joypads[i] = 0;
for (j=0; j<4; j++) {
JOYPAD_IO.directions = joypad_masks[(i*4)+j];
for (j = 0; j < 4; j++) {
JOYPAD_IO.directions = joypad_masks[(i * 4) + j];
cur_fire = (~(JOYPAD_IO.fires) & 0xc)<<14;
cur_dir = (~(JOYPAD_IO.directions)>>12) & 15;
cur_fire = (~(JOYPAD_IO.fires) & 0xc) << 14;
cur_dir = (~(JOYPAD_IO.directions) >> 12) & 15;
jp_joypads[i] |= cur_fire<<(j*2);
jp_joypads[i] |= cur_dir<<(j*4);
jp_joypads[i] |= cur_fire << (j * 2);
jp_joypads[i] |= cur_dir << (j * 4);
}
}
JOYPAD_IO.directions=0xffff;
JOYPAD_IO.directions = 0xffff;
}
#endif /* SDL_JOYSTICK_MINT */
......
......@@ -134,12 +134,12 @@ SDL_Atari_InitInternalKeymap(_THIS)
keytab_normal = key_tables->unshift;
/* Initialize keymap */
for ( i=0; i<ATARIBIOS_MAXKEYS; i++ )
for (i = 0; i < ATARIBIOS_MAXKEYS; i++)
keymap[i] = SDLK_UNKNOWN;
/* Functions keys */
for ( i = 0; i<10; i++ )
keymap[SCANCODE_F1 + i] = SDLK_F1+i;
for (i = 0; i < 10; i++)
keymap[SCANCODE_F1 + i] = SDLK_F1 + i;
/* Cursor keypad */
keymap[SCANCODE_HELP] = SDLK_HELP;
......@@ -208,8 +208,7 @@ Uint16 SDL_AtariToUnicodeTable[256] = {
};
SDL_keysym *
SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
SDL_bool pressed)
SDL_Atari_TranslateKey(int scancode, SDL_keysym * keysym, SDL_bool pressed)
{
int asciicode = 0;
......@@ -227,7 +226,7 @@ SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
keysym->unicode = SDL_AtariToUnicodeTable[asciicode];
}
return(keysym);
return (keysym);
}
/* vi: set ts=4 sw=4 expandtab: */
......@@ -36,8 +36,9 @@
/* Special keys state */
#ifndef K_RSHIFT
enum {
K_RSHIFT=0,
enum
{
K_RSHIFT = 0,
K_LSHIFT,
K_CTRL,
K_ALT,
......@@ -55,7 +56,7 @@ extern void SDL_Atari_InitInternalKeymap(_THIS);
/* Atari to Unicode charset translation table */
extern Uint16 SDL_AtariToUnicodeTable[256];
SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym * keysym,
SDL_bool pressed);
#endif /* _SDL_ATARI_EVENTS_H_ */
......
......@@ -62,7 +62,7 @@ AtariBios_InitOSKeymap(_THIS)
}
/*if (Getcookie(C_MiNT, &dummy) == C_FOUND) {
vectors_mask = 0;
}*/
} */
SDL_AtariXbios_InstallVectors(vectors_mask);
}
......@@ -78,8 +78,9 @@ AtariBios_PumpEvents(_THIS)
while (Bconstat(_CON)) {
unsigned long key_pressed;
key_pressed=Bconin(_CON);
bios_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
key_pressed = Bconin(_CON);
bios_currentkeyboard[(key_pressed >> 16) & (ATARIBIOS_MAXKEYS - 1)] =
0xFF;
}
/* Read special keys */
......@@ -95,7 +96,8 @@ AtariBios_PumpEvents(_THIS)
/* Key unpressed ? */
if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
SDL_PrivateKeyboard(SDL_RELEASED,
SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
SDL_Atari_TranslateKey(i, &keysym,
SDL_FALSE));
}
if (use_dev_mouse) {
......
......@@ -45,8 +45,9 @@ static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS];
static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS];
static SDL_bool use_dev_mouse = SDL_FALSE;
enum {
DEV_BUSY=0,
enum
{
DEV_BUSY = 0,
DEV_READY
};
......@@ -69,7 +70,7 @@ AtariGemdos_InitOSKeymap(_THIS)
}
/*if (Getcookie(C_MiNT, &dummy) == C_FOUND) {
vectors_mask = 0;
}*/
} */
SDL_AtariXbios_InstallVectors(vectors_mask);
}
......@@ -85,8 +86,9 @@ AtariGemdos_PumpEvents(_THIS)
while (Cconis() != DEV_BUSY) {
unsigned long key_pressed;
key_pressed=Cnecin();
gemdos_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
key_pressed = Cnecin();
gemdos_currentkeyboard[(key_pressed >> 16) & (ATARIBIOS_MAXKEYS - 1)]
= 0xFF;
}
/* Read special keys */
......@@ -102,7 +104,8 @@ AtariGemdos_PumpEvents(_THIS)
/* Key unpressed ? */
if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
SDL_PrivateKeyboard(SDL_RELEASED,
SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
SDL_Atari_TranslateKey(i, &keysym,
SDL_FALSE));
}
if (use_dev_mouse) {
......
......@@ -46,7 +46,8 @@ static Uint16 atari_prevmouseb; /* save state of mouse buttons */
void
AtariIkbd_InitOSKeymap(_THIS)
{
SDL_memset(SDL_AtariIkbd_keyboard, KEY_UNDEFINED, sizeof(SDL_AtariIkbd_keyboard));
SDL_memset(SDL_AtariIkbd_keyboard, KEY_UNDEFINED,
sizeof(SDL_AtariIkbd_keyboard));
/* Now install our handler */
SDL_AtariIkbd_mouseb = SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
......@@ -90,7 +91,8 @@ AtariIkbd_PumpEvents(_THIS)
/* Key released ? */
if (SDL_AtariIkbd_keyboard[i] == KEY_RELEASED) {
SDL_PrivateKeyboard(SDL_RELEASED,
SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
SDL_Atari_TranslateKey(i, &keysym,
SDL_FALSE));
SDL_AtariIkbd_keyboard[i] = KEY_UNDEFINED;
}
}
......
......@@ -152,8 +152,10 @@ SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
}
}
void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
void
SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
{
SDL_AtariXbios_mouselock = lockPosition;
}
/* vi: set ts=4 sw=4 expandtab: */
......@@ -147,7 +147,8 @@ GEM_PumpEvents(_THIS)
/* Key unpressed ? */
if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
SDL_PrivateKeyboard(SDL_RELEASED,
SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
SDL_Atari_TranslateKey(i, &keysym,
SDL_FALSE));
}
SDL_memcpy(gem_previouskeyboard, gem_currentkeyboard,
......@@ -291,8 +292,8 @@ do_keyboard(short kc, short ks)
int scancode, asciicode;
if (kc) {
scancode=(kc>>8) & (ATARIBIOS_MAXKEYS-1);
gem_currentkeyboard[scancode]=0xFF;
scancode = (kc >> 8) & (ATARIBIOS_MAXKEYS - 1);
gem_currentkeyboard[scancode] = 0xFF;
}
/* Read special keys */
......
......@@ -205,7 +205,7 @@ GEM_CreateDevice(int devindex)
}
/*if (Getcookie(C_MiNT, &dummy) == C_FOUND) {
vectors_mask = 0;
}*/
} */
SDL_AtariXbios_InstallVectors(vectors_mask);
......
......@@ -171,8 +171,8 @@ XBIOS_CreateDevice(int devindex)
device->VideoQuit = XBIOS_VideoQuit;
/* Modes */
device->GetDisplayModes = NULL /*XBIOS_GetDisplayModes*/;
device->SetDisplayMode = NULL /*XBIOS_SetDisplayMode*/;
device->GetDisplayModes = NULL /*XBIOS_GetDisplayModes */ ;
device->SetDisplayMode = NULL /*XBIOS_SetDisplayMode */ ;
/* Events */
device->PumpEvents = SDL_Atari_PumpEvents;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment