Cleaned up most of the warnings, eliminated use of deprecated APIs, and fixed the hotkeys crashing.

CQTexperiment
Chris Moeller 2013-10-03 01:00:58 -07:00
parent 51cc8a69e5
commit ec0e45381e
137 changed files with 2654 additions and 10203 deletions

View File

@ -161,19 +161,19 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
p = [NSOpenPanel openPanel];
[p setAllowedFileTypes:[playlistLoader acceptableFileTypes]];
[p setCanChooseDirectories:YES];
[p setAllowsMultipleSelection:YES];
[p setResolvesAliases:YES];
[p beginSheetForDirectory:nil file:nil types:[playlistLoader acceptableFileTypes] modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
}
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton)
{
[playlistLoader willInsertURLs:[panel URLs] origin:URLOriginInternal];
[playlistLoader didInsertURLs:[playlistLoader addURLs:[panel URLs] sort:YES] origin:URLOriginInternal];
}
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSFileHandlingPanelOKButton ) {
[playlistLoader willInsertURLs:[p URLs] origin:URLOriginInternal];
[playlistLoader didInsertURLs:[playlistLoader addURLs:[p URLs] sort:YES] origin:URLOriginInternal];
} else {
[p close];
}
}];
}
- (IBAction)savePlaylist:(id)sender
@ -182,16 +182,13 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
p = [NSSavePanel savePanel];
[p setAllowedFileTypes:[playlistLoader acceptablePlaylistTypes]];
[p beginSheetForDirectory:nil file:nil modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
}
- (void)savePanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton)
{
[playlistLoader save:[panel filename]];
}
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSFileHandlingPanelOKButton ) {
[playlistLoader save:[[p URL] path]];
} else {
[p close];
}
}];
}
- (IBAction)openURL:(id)sender
@ -265,7 +262,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
if ([fileManager fileExistsAtPath: folder] == NO)
{
[fileManager createDirectoryAtPath: folder attributes: nil];
[fileManager createDirectoryAtPath: folder withIntermediateDirectories:NO attributes:nil error:nil];
}
NSString *fileName = @"Default.m3u";

View File

@ -17,19 +17,19 @@
{
case NX_KEYTYPE_PLAY:
if( state == 0 )
[[self delegate] clickPlay]; //Play pressed and released
[(AppController *)[self delegate] clickPlay]; //Play pressed and released
break;
case NX_KEYTYPE_NEXT:
case NX_KEYTYPE_FAST:
if( state == 0 )
[[self delegate] clickNext]; //Next pressed and released
[(AppController *)[self delegate] clickNext]; //Next pressed and released
break;
case NX_KEYTYPE_PREVIOUS:
case NX_KEYTYPE_REWIND:
if( state == 0 )
[[self delegate] clickPrev]; //Previous pressed and released
[(AppController *)[self delegate] clickPrev]; //Previous pressed and released
break;
}
}

View File

@ -111,7 +111,7 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
- (IBAction)play:(id)sender
{
if ([playlistView selectedRow] == -1)
[playlistView selectRow:0 byExtendingSelection:NO];
[playlistView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
if ([playlistView selectedRow] > -1)
[self playEntryAtIndex:[playlistView selectedRow]];

View File

@ -54,8 +54,6 @@
- (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi;
- (void)resetNextStreams;
- (void)setRGInfo:(NSDictionary *)rgi;
+ (NSArray *)fileTypes;
+ (NSArray *)schemes;
+ (NSArray *)containerTypes;

View File

@ -17,12 +17,12 @@ void PrintStreamDesc (AudioStreamBasicDescription *inDesc)
printf ("- - - - - - - - - - - - - - - - - - - -\n");
printf (" Sample Rate:%f\n", inDesc->mSampleRate);
printf (" Format ID:%s\n", (char*)&inDesc->mFormatID);
printf (" Format Flags:%lX\n", inDesc->mFormatFlags);
printf (" Bytes per Packet:%ld\n", inDesc->mBytesPerPacket);
printf (" Frames per Packet:%ld\n", inDesc->mFramesPerPacket);
printf (" Bytes per Frame:%ld\n", inDesc->mBytesPerFrame);
printf (" Channels per Frame:%ld\n", inDesc->mChannelsPerFrame);
printf (" Bits per Channel:%ld\n", inDesc->mBitsPerChannel);
printf (" Format Flags:%X\n", inDesc->mFormatFlags);
printf (" Bytes per Packet:%d\n", inDesc->mBytesPerPacket);
printf (" Frames per Packet:%d\n", inDesc->mFramesPerPacket);
printf (" Bytes per Frame:%d\n", inDesc->mBytesPerFrame);
printf (" Channels per Frame:%d\n", inDesc->mChannelsPerFrame);
printf (" Bits per Channel:%d\n", inDesc->mBitsPerChannel);
printf ("- - - - - - - - - - - - - - - - - - - -\n");
}

View File

@ -81,9 +81,12 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
if (outputDevice == -1) {
NSLog(@"DEVICE IS -1");
UInt32 size = sizeof(AudioDeviceID);
err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
&size,
&deviceID);
AudioObjectPropertyAddress theAddress = {
.mSelector = kAudioHardwarePropertyDefaultOutputDevice,
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster
};
err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &size, &deviceID);
if (err != noErr) {
NSLog(@"THERES NO DEFAULT OUTPUT DEVICE");
@ -250,7 +253,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
- (void)resume
{
OSStatus err = AudioOutputUnitStart(outputUnit);
AudioOutputUnitStart(outputUnit);
}
@end

View File

@ -10,7 +10,7 @@
- (BOOL)seekable;
- (BOOL)seek:(long)position whence:(int)whence;
- (long)tell;
- (int)read:(void *)buffer amount:(int)amount; //reads UP TO amount, returns amount read.
- (long)read:(void *)buffer amount:(long)amount; //reads UP TO amount, returns amount read.
- (void)close;
@end
@ -53,7 +53,7 @@
@protocol CogMetadataWriter <NSObject>
//+ (NSArray *)fileTypes;
//+ (NSArray *)mimeTypes;
+ (int)putMetadataInURL:(NSURL *)url;
+ (int)putMetadataInURL:(NSURL *)url tagData:(NSDictionary *)tagData;
@end
@protocol CogPropertiesReader <NSObject>

View File

@ -89,7 +89,7 @@ static PluginController *sharedPluginController = nil;
- (void)loadPluginsAtPath:(NSString *)path
{
NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:path];
NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
for (NSString *pname in dirContents)
{
@ -272,5 +272,10 @@ static PluginController *sharedPluginController = nil;
}
}
- (int)putMetadataInURL:(NSURL *)url
{
return 0;
}
@end

View File

@ -25,6 +25,8 @@
#import "AudioScrobblerClient.h"
#include <arpa/inet.h>
#define kBufferSize 1024
#define kPortsToStep 5

File diff suppressed because it is too large Load Diff

View File

@ -20,13 +20,14 @@
- (void)updatePath
{
NSArray *contents = [[[NSFileManager defaultManager] directoryContentsAtPath:[url path]] sortedArrayUsingSelector:@selector(finderCompare:)];
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url includingPropertiesForKeys:[NSArray arrayWithObjects:NSURLNameKey, NSURLIsDirectoryKey, nil] options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:^BOOL(NSURL *url, NSError *error) {
return NO;
}];
NSMutableArray *fullPaths = [[NSMutableArray alloc] init];
for (NSString *s in contents)
for (NSURL * theUrl in enumerator)
{
if (![s hasPrefix:@"."])
[fullPaths addObject:[[url path] stringByAppendingPathComponent: s]];
[fullPaths addObject:[theUrl path]];
}
[self processPaths: fullPaths];

View File

@ -18,6 +18,7 @@
- (IBAction)addToPlaylist:(id)sender;
- (IBAction)setAsPlaylist:(id)sender;
- (IBAction)playPauseResume:(NSObject *)id;
- (IBAction)showEntryInFinder:(id)sender;
- (IBAction)setAsRoot:(id)sender;

View File

@ -14,7 +14,7 @@
- (IBAction)addToPlaylist:(id)sender
{
unsigned int index;
NSUInteger index;
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
NSMutableArray *urls = [[NSMutableArray alloc] init];
@ -41,7 +41,7 @@
- (IBAction)showEntryInFinder:(id)sender
{
unsigned int index;
NSUInteger index;
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
@ -55,7 +55,7 @@
- (IBAction)setAsRoot:(id)sender
{
unsigned int index = [[outlineView selectedRowIndexes] firstIndex];
NSUInteger index = [[outlineView selectedRowIndexes] firstIndex];
if (index != NSNotFound)
{

View File

@ -39,7 +39,7 @@
change:(NSDictionary *)change
context:(void *)context
{
NSLog([[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]);
NSLog(@"File tree root URL: %@\n", [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]);
if ([keyPath isEqualToString:@"values.fileTreeRootURL"]) {
[self setRootURL:[NSURL URLWithString:[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]]];
}

View File

@ -6,6 +6,7 @@
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "FileTreeController.h"
#import "FileTreeOutlineView.h"
#import "FileTreeViewController.h"
#import "PlaybackController.h"
@ -30,13 +31,13 @@
if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter))
{
[[self delegate] addToPlaylist:self];
[(FileTreeController *)[self delegate] addToPlaylist:self];
return;
}
else if (modifiers == 0 && c == ' ')
{
[[self delegate] playPauseResume:self];
[(FileTreeController *)[self delegate] playPauseResume:self];
return;
}
}
@ -66,7 +67,7 @@
}
else if (!currentRowIsSelected)
{
[self selectRow:iRow byExtendingSelection:NO];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:iRow] byExtendingSelection:NO];
}
return contextMenu;

View File

@ -263,7 +263,7 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx)
byteSwap(ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
if(0 != ctx->internal_buf) {
free(ctx->internal_buf);
ctx->internal_buf = 0;

View File

@ -434,7 +434,7 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type
{
FLAC__StreamMetadata *object;
if(type > FLAC__MAX_METADATA_TYPE_CODE)
if((unsigned int)type > FLAC__MAX_METADATA_TYPE_CODE)
return 0;
object = (FLAC__StreamMetadata*)calloc(1, sizeof(FLAC__StreamMetadata));

View File

@ -221,11 +221,11 @@ void Ay_Apu::run_until( blip_time_t final_end_time )
blip_time_t end_time = final_end_time;
int const vol_mode = regs [0x08 + index];
int const vol_mode_mask = type_ == Ay8914 ? 0x30 : 0x10;
int volume = amp_table [vol_mode & 0x0F] >> half_vol + env_step_scale;
int volume = amp_table [vol_mode & 0x0F] >> (half_vol + env_step_scale);
int osc_env_pos = env_pos;
if ( vol_mode & vol_mode_mask )
{
volume = env_wave [osc_env_pos] >> half_vol + env_step_scale;
volume = env_wave [osc_env_pos] >> (half_vol + env_step_scale);
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
// use envelope only if it's a repeating wave or a ramp that hasn't finished
if ( !(regs [13] & 1) || osc_env_pos < -32 )
@ -374,7 +374,7 @@ void Ay_Apu::run_until( blip_time_t final_end_time )
// next envelope step
if ( ++osc_env_pos >= 0 )
osc_env_pos -= 32;
volume = env_wave [osc_env_pos] >> half_vol + env_step_scale;
volume = env_wave [osc_env_pos] >> (half_vol + env_step_scale);
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
start_time = end_time;

View File

@ -255,7 +255,6 @@ void Dual_Resampler::mix_extra_mono( Stereo_Buffer& stereo_buf, dsample_t out_ [
typedef dsample_t stereo_dsample_t [2];
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
int offset = -count;
int const gain = gain_;
do
{
int s = BLIP_READER_READ_RAW( sn ) >> (blip_sample_bits - 16);
@ -290,7 +289,6 @@ void Dual_Resampler::mix_extra_stereo( Stereo_Buffer& stereo_buf, dsample_t out_
typedef dsample_t stereo_dsample_t [2];
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
int offset = -count;
int const gain = gain_;
do
{
int sc = BLIP_READER_READ_RAW( snc ) >> (blip_sample_bits - 16);

View File

@ -1330,7 +1330,7 @@ blargg_err_t Vgm_Core::init_chips( double* rate, bool reinit )
}
if ( qsound_rate )
{
double pcm_rate = (double)qsound_rate / 166.0;
/*double pcm_rate = (double)qsound_rate / 166.0;*/
if ( !reinit )
{
int result = qsound[0].set_rate( qsound_rate );

View File

@ -48,6 +48,7 @@ Unmapped registers:
#include <memory.h>
#include "c140.h"
#undef NULL
#define NULL ((void *)0)
#define MAX_VOICE 24

View File

@ -3842,12 +3842,12 @@ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length)
/* Check YM2610B warning message */
if( FM_KEY_IS(&F2610->CH[0].SLOT[3]) )
{
LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,0));
/*LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,0));*/
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
}
if( FM_KEY_IS(&F2610->CH[3].SLOT[3]) )
{
LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,3));
/*LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,3));*/
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
}
#endif

View File

@ -1497,8 +1497,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
}
else
{ /* set IRQ mask ,timer enable*/
UINT8 st1 = v&1;
UINT8 st2 = (v>>1)&1;
/*UINT8 st1 = v&1;
UINT8 st2 = (v>>1)&1;*/
/* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */
OPL_STATUS_RESET(OPL, v & (0x78-0x08) );
@ -1526,8 +1526,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
{
if(OPL->keyboardhandler_w)
OPL->keyboardhandler_w(OPL->keyboard_param,v);
else
logerror("Y8950: write unmapped KEYBOARD port\n");
/*else
logerror("Y8950: write unmapped KEYBOARD port\n");*/
}
break;
case 0x07: /* DELTA-T control 1 : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */
@ -1561,7 +1561,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
case 0x15: /* DAC data high 8 bits (F7,F6...F2) */
case 0x16: /* DAC data low 2 bits (F1, F0 in bits 7,6) */
case 0x17: /* DAC data shift (S2,S1,S0 in bits 2,1,0) */
logerror("FMOPL.C: DAC data register written, but not implemented reg=%02x val=%02x\n",r,v);
/*logerror("FMOPL.C: DAC data register written, but not implemented reg=%02x val=%02x\n",r,v);*/
break;
case 0x18: /* I/O CTRL (Direction) */
@ -1578,7 +1578,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
break;
#endif
default:
logerror("FMOPL.C: write to unknown register: %02x\n",r);
/*logerror("FMOPL.C: write to unknown register: %02x\n",r);*/
break;
}
break;
@ -2095,8 +2095,8 @@ static unsigned char OPLRead(FM_OPL *OPL,int a)
{
if(OPL->keyboardhandler_r)
return OPL->keyboardhandler_r(OPL->keyboard_param);
else
logerror("Y8950: read unmapped KEYBOARD port\n");
/*else
logerror("Y8950: read unmapped KEYBOARD port\n");*/
}
return 0;
@ -2116,14 +2116,14 @@ static unsigned char OPLRead(FM_OPL *OPL,int a)
{
if(OPL->porthandler_r)
return OPL->porthandler_r(OPL->port_param);
else
logerror("Y8950:read unmapped I/O port\n");
/*else
logerror("Y8950:read unmapped I/O port\n");*/
}
return 0;
case 0x1a: /* PCM-DATA */
if(OPL->type&OPL_TYPE_ADPCM)
{
logerror("Y8950 A/D convertion is accessed but not implemented !\n");
/*logerror("Y8950 A/D convertion is accessed but not implemented !\n");*/
return 0x80; /* 2's complement PCM data - result from A/D convertion */
}
return 0;

View File

@ -303,7 +303,7 @@ INLINE void check_bounds( k053260_state *ic, int channel )
UINT32 channel_end = channel_start + ic->channels[channel].size - 1;
if ( channel_start > ic->rom_size ) {
logerror("K53260: Attempting to start playing past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );
/*logerror("K53260: Attempting to start playing past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );*/
ic->channels[channel].play = 0;
@ -311,11 +311,11 @@ INLINE void check_bounds( k053260_state *ic, int channel )
}
if ( channel_end > ic->rom_size ) {
logerror("K53260: Attempting to play past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );
/*logerror("K53260: Attempting to play past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );*/
ic->channels[channel].size = ic->rom_size - channel_start;
}
if (LOG) logerror("K053260: Sample Start = %06x, Sample End = %06x, Sample rate = %04x, PPCM = %s\n", channel_start, channel_end, ic->channels[channel].rate, ic->channels[channel].ppcm ? "yes" : "no" );
/*if (LOG) logerror("K053260: Sample Start = %06x, Sample End = %06x, Sample rate = %04x, PPCM = %s\n", channel_start, channel_end, ic->channels[channel].rate, ic->channels[channel].ppcm ? "yes" : "no" );*/
}
//WRITE8_DEVICE_HANDLER( k053260_w )
@ -328,7 +328,7 @@ void k053260_w(void *chip, offs_t offset, UINT8 data)
k053260_state *ic = (k053260_state *) chip;
if ( r > 0x2f ) {
logerror("K053260: Writing past registers\n" );
/*logerror("K053260: Writing past registers\n" );*/
return;
}
@ -462,7 +462,7 @@ UINT8 k053260_r(void *chip, offs_t offset)
if ( offs > ic->rom_size ) {
//logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine().describe_context(),offs,ic->rom_size );
logerror("K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", offs,ic->rom_size );
/*logerror("K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", offs,ic->rom_size );*/
return 0;
}

View File

@ -28,6 +28,7 @@ CHANNEL_DEBUG enables the following keys:
#endif
#include "k054539.h"
#undef NULL
#define NULL ((void *)0)
#define CHANNEL_DEBUG 0
@ -365,7 +366,7 @@ else
break;
}
default:
LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch));
/*LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch));*/
break;
}
chan->pos = cur_pos;
@ -664,7 +665,7 @@ UINT8 k054539_r(void *chip, offs_t offset)
case 0x22c:
break;
default:
LOG(("K054539 read %03x\n", offset));
/*LOG(("K054539 read %03x\n", offset));*/
break;
}
return info->regs[offset];

View File

@ -279,7 +279,6 @@ void device_reset_okim6258(void *chip)
void okim6258_set_divider(void *chip, int val)
{
okim6258_state *info = (okim6258_state *) chip;
int divider = dividers[val];
info->divider = dividers[val];
//stream_set_sample_rate(info->stream, info->master_clock / divider);
@ -402,7 +401,7 @@ void okim6258_ctrl_w(void *chip, offs_t offset, UINT8 data)
if (data & COMMAND_RECORD)
{
logerror("M6258: Record enabled\n");
/*logerror("M6258: Record enabled\n");*/
info->status |= STATUS_RECORDING;
}
else

View File

@ -605,7 +605,7 @@ void okim6295_write_command(okim6295_state *info, UINT8 data)
else
{
//logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag(),info->command);
logerror("OKIM6295: Voice %u requested to play invalid sample %02x\n",i,info->command);
/*logerror("OKIM6295: Voice %u requested to play invalid sample %02x\n",i,info->command);*/
voice->playing = 0;
}
}

View File

@ -9,6 +9,7 @@
#include "rf5c68.h"
#include <math.h>
#undef NULL
#define NULL ((void *)0)

View File

@ -8,15 +8,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mamedef.h"
#include "ym2151.h"
#ifndef logerror
#define logerror (void)
#endif
/* struct describing a single operator */
#include "mamedef.h"
#include "ym2151.h"
#ifndef logerror
#define logerror (void)
#endif
/* struct describing a single operator */
typedef struct
{
UINT32 phase; /* accumulated operator phase */
@ -961,7 +961,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
break;
default:
logerror("YM2151 Write %02x to undocumented register #%02x\n",v,r);
/*logerror("YM2151 Write %02x to undocumented register #%02x\n",v,r);*/
break;
}
break;
@ -977,13 +977,13 @@ void ym2151_write_reg(void *_chip, int r, int v)
chip->connect[r&7] = v&7;
set_connect(chip, op, r&7, v&7);
break;
case 0x08: /* Key Code */
v &= 0x7f;
if (v != (int)(op->kc))
{
UINT32 kc, kc_channel;
case 0x08: /* Key Code */
v &= 0x7f;
if (v != (int)(op->kc))
{
UINT32 kc, kc_channel;
kc_channel = (v - (v>>2))*64;
kc_channel += 768;
kc_channel |= (op->kc_i & 63);
@ -1014,13 +1014,13 @@ void ym2151_write_reg(void *_chip, int r, int v)
refresh_EG( op );
}
break;
case 0x10: /* Key Fraction */
v >>= 2;
if (v != (int)(op->kc_i & 63))
{
UINT32 kc_channel;
case 0x10: /* Key Fraction */
v >>= 2;
if (v != (int)(op->kc_i & 63))
{
UINT32 kc_channel;
kc_channel = v;
kc_channel |= (op->kc_i & ~63);
@ -1633,13 +1633,13 @@ INLINE void advance_eg(YM2151 *PSG)
case EG_DEC: /* decay phase */
if ( !(PSG->eg_cnt & ((1<<op->eg_sh_d1r)-1) ) )
{
op->volume += eg_inc[op->eg_sel_d1r + ((PSG->eg_cnt>>op->eg_sh_d1r)&7)];
if ( op->volume >= (INT32)(op->d1l) )
op->state = EG_SUS;
}
{
op->volume += eg_inc[op->eg_sel_d1r + ((PSG->eg_cnt>>op->eg_sh_d1r)&7)];
if ( op->volume >= (INT32)(op->d1l) )
op->state = EG_SUS;
}
break;
case EG_SUS: /* sustain phase */

View File

@ -41,18 +41,18 @@ to do:
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "mamedef.h"
#include "ym2413.h"
#ifndef INLINE
#define INLINE static __inline
#endif
#ifndef logerror
#define logerror (void)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#include "mamedef.h"
#include "ym2413.h"
#ifndef INLINE
#define INLINE static __inline
#endif
#ifndef logerror
#define logerror (void)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
/* output final shift */
@ -581,24 +581,24 @@ static const unsigned char table_vrc7[15][8] =
{0x01, 0x02, 0xD3, 0x05, 0x82, 0xA2, 0x31, 0x51},
{0x61, 0x22, 0x0D, 0x02, 0xC3, 0x7F, 0x24, 0x05},
{0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x44, 0x17},
};
INLINE int limit( int val, int max, int min ) {
if ( val > max )
val = max;
else if ( val < min )
};
INLINE int limit( int val, int max, int min ) {
if ( val > max )
val = max;
else if ( val < min )
val = min;
return val;
}
/* advance LFO to next sample */
INLINE void advance_lfo(YM2413 *chip)
{
/* LFO */
chip->lfo_am_cnt += chip->lfo_am_inc;
/* advance LFO to next sample */
INLINE void advance_lfo(YM2413 *chip)
{
/* LFO */
chip->lfo_am_cnt += chip->lfo_am_inc;
if (chip->lfo_am_cnt >= ((UINT32)LFO_AM_TAB_ELEMENTS<<LFO_SH) ) /* lfo_am_table is 210 elements long */
chip->lfo_am_cnt -= ((UINT32)LFO_AM_TAB_ELEMENTS<<LFO_SH);
@ -606,13 +606,13 @@ INLINE void advance_lfo(YM2413 *chip)
chip->lfo_pm_cnt += chip->lfo_pm_inc;
chip->LFO_PM = (chip->lfo_pm_cnt>>LFO_SH) & 7;
}
/* advance to next sample */
INLINE void advance(YM2413 *chip)
{
OPLL_CH *CH;
OPLL_SLOT *op;
}
/* advance to next sample */
INLINE void advance(YM2413 *chip)
{
OPLL_CH *CH;
OPLL_SLOT *op;
unsigned int i;
/* Envelope Generator */
@ -669,13 +669,13 @@ INLINE void advance(YM2413 *chip)
case EG_DEC: /* decay phase */
if ( !(chip->eg_cnt & ((1<<op->eg_sh_dr)-1) ) )
{
op->volume += eg_inc[op->eg_sel_dr + ((chip->eg_cnt>>op->eg_sh_dr)&7)];
if ( op->volume >= (INT32)(op->sl) )
op->state = EG_SUS;
}
break;
{
op->volume += eg_inc[op->eg_sel_dr + ((chip->eg_cnt>>op->eg_sh_dr)&7)];
if ( op->volume >= (INT32)(op->sl) )
op->state = EG_SUS;
}
break;
case EG_SUS: /* sustain phase */
/* this is important behaviour:
@ -836,24 +836,24 @@ INLINE void advance(YM2413 *chip)
i--;
}
}
INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p;
}
INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p;
p = (env<<5) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<17))) >> FREQ_SH ) & SIN_MASK) ];
if (p >= TL_TAB_LEN)
return 0;
return tl_tab[p];
}
INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p;
INT32 i;
return tl_tab[p];
}
INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab)
{
UINT32 p;
INT32 i;
i = (phase & ~FREQ_MASK) + pm;
@ -869,13 +869,13 @@ INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsign
}
#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (chip->LFO_AM & (OP)->AMmask))
/* calculate output */
INLINE void chan_calc( YM2413 *chip, OPLL_CH *CH )
{
OPLL_SLOT *SLOT;
unsigned int env;
#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (chip->LFO_AM & (OP)->AMmask))
/* calculate output */
INLINE void chan_calc( YM2413 *chip, OPLL_CH *CH )
{
OPLL_SLOT *SLOT;
unsigned int env;
signed int out;
signed int phase_modulation; /* phase modulation input (SLOT 2) */
@ -943,13 +943,13 @@ number number BLK/FNUM2 FNUM Drum Hat Drum Tom Cymbal
8 14,17 B8 A8 + + +
*/
/* calculate rhythm */
INLINE void rhythm_calc( YM2413 *chip, OPLL_CH *CH, unsigned int noise )
{
OPLL_SLOT *SLOT;
signed int out;
/* calculate rhythm */
INLINE void rhythm_calc( YM2413 *chip, OPLL_CH *CH, unsigned int noise )
{
OPLL_SLOT *SLOT;
signed int out;
unsigned int env;
signed int phase_modulation; /* phase modulation input (SLOT 2) */
@ -1277,24 +1277,24 @@ static void OPLL_initalize(YM2413 *chip)
chip->eg_timer_add = (1<<EG_SH) * chip->freqbase;
chip->eg_timer_overflow = ( 1 ) * (1<<EG_SH);
/*logerror("YM2413init eg_timer_add=%8x eg_timer_overflow=%8x\n", chip->eg_timer_add, chip->eg_timer_overflow);*/
}
INLINE void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set)
{
if( !SLOT->key )
{
/*logerror("YM2413init eg_timer_add=%8x eg_timer_overflow=%8x\n", chip->eg_timer_add, chip->eg_timer_overflow);*/
}
INLINE void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set)
{
if( !SLOT->key )
{
/* do NOT restart Phase Generator (verified on real YM2413)*/
/* phase -> Dump */
SLOT->state = EG_DMP;
}
SLOT->key |= key_set;
}
INLINE void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr)
{
if( SLOT->key )
{
SLOT->key |= key_set;
}
INLINE void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr)
{
if( SLOT->key )
{
SLOT->key &= key_clr;
if( !SLOT->key )
@ -1304,13 +1304,13 @@ INLINE void KEY_OFF(OPLL_SLOT *SLOT, UINT32 key_clr)
SLOT->state = EG_REL;
}
}
}
/* update phase increment counter of operator (also update the EG rates if necessary) */
INLINE void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT)
{
int ksr;
UINT32 SLOT_rs;
}
/* update phase increment counter of operator (also update the EG rates if necessary) */
INLINE void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT)
{
int ksr;
UINT32 SLOT_rs;
UINT32 SLOT_dp;
/* (frequency) phase increment counter */
@ -1350,13 +1350,13 @@ INLINE void CALC_FCSLOT(OPLL_CH *CH,OPLL_SLOT *SLOT)
SLOT_dp = 16 + (13<<2);
SLOT->eg_sh_dp = eg_rate_shift [SLOT_dp + SLOT->ksr ];
SLOT->eg_sel_dp = eg_rate_select[SLOT_dp + SLOT->ksr ];
}
/* set multi,am,vib,EG-TYP,KSR,mul */
INLINE void set_mul(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
}
/* set multi,am,vib,EG-TYP,KSR,mul */
INLINE void set_mul(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
SLOT->mul = mul_tab[v&0x0f];
SLOT->KSR = (v&0x10) ? 0 : 2;
@ -1364,13 +1364,13 @@ INLINE void set_mul(YM2413 *chip,int slot,int v)
SLOT->vib = (v&0x40);
SLOT->AMmask = (v&0x80) ? ~0 : 0;
CALC_FCSLOT(CH,SLOT);
}
/* set ksl, tl */
INLINE void set_ksl_tl(YM2413 *chip,int chan,int v)
{
int ksl;
OPLL_CH *CH = &chip->P_CH[chan];
}
/* set ksl, tl */
INLINE void set_ksl_tl(YM2413 *chip,int chan,int v)
{
int ksl;
OPLL_CH *CH = &chip->P_CH[chan];
/* modulator */
OPLL_SLOT *SLOT = &CH->SLOT[SLOT1];
@ -1379,13 +1379,13 @@ INLINE void set_ksl_tl(YM2413 *chip,int chan,int v)
SLOT->ksl = ksl ? 3-ksl : 31;
SLOT->TL = (v&0x3f)<<(ENV_BITS-2-7); /* 7 bits TL (bit 6 = always 0) */
SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl);
}
/* set ksl , waveforms, feedback */
INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v)
{
int ksl;
OPLL_CH *CH = &chip->P_CH[chan];
}
/* set ksl , waveforms, feedback */
INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v)
{
int ksl;
OPLL_CH *CH = &chip->P_CH[chan];
/* modulator */
OPLL_SLOT *SLOT = &CH->SLOT[SLOT1];
SLOT->wavetable = ((v&0x08)>>3)*SIN_LEN;
@ -1399,13 +1399,13 @@ INLINE void set_ksl_wave_fb(YM2413 *chip,int chan,int v)
SLOT->TLL = SLOT->TL + (CH->ksl_base>>SLOT->ksl);
SLOT->wavetable = ((v&0x10)>>4)*SIN_LEN;
}
/* set attack rate & decay rate */
INLINE void set_ar_dr(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
}
/* set attack rate & decay rate */
INLINE void set_ar_dr(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
SLOT->ar = (v>>4) ? 16 + ((v>>4) <<2) : 0;
@ -1423,13 +1423,13 @@ INLINE void set_ar_dr(YM2413 *chip,int slot,int v)
SLOT->dr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0;
SLOT->eg_sh_dr = eg_rate_shift [SLOT->dr + SLOT->ksr ];
SLOT->eg_sel_dr = eg_rate_select[SLOT->dr + SLOT->ksr ];
}
/* set sustain level & release rate */
INLINE void set_sl_rr(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
}
/* set sustain level & release rate */
INLINE void set_sl_rr(YM2413 *chip,int slot,int v)
{
OPLL_CH *CH = &chip->P_CH[slot/2];
OPLL_SLOT *SLOT = &CH->SLOT[slot&1];
SLOT->sl = sl_tab[ v>>4 ];
@ -1575,7 +1575,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
if ((chip->rhythm&0x20)==0)
/*rhythm off to on*/
{
logerror("YM2413: Rhythm mode enable\n");
/*logerror("YM2413: Rhythm mode enable\n");*/
/* Load instrument settings for channel seven(chan=6 since we're zero based). (Bass drum) */
chan = 6;
@ -1637,7 +1637,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
if ((chip->rhythm&0x20)==1)
/*rhythm on to off*/
{
logerror("YM2413: Rhythm mode disable\n");
/*logerror("YM2413: Rhythm mode disable\n");*/
/* Load instrument settings for channel seven(chan=6 since we're zero based).*/
chan = 6;
inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0];
@ -1678,13 +1678,13 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
}
break;
case 0x10:
case 0x20:
{
UINT32 block_fnum;
chan = r&0x0f;
case 0x10:
case 0x20:
{
UINT32 block_fnum;
chan = r&0x0f;
if (chan >= 9)
chan -= 9; /* verified on real YM2413 */
@ -1710,8 +1710,8 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
}
if (CH->sus!=(v&0x20))
logerror("chan=%i sus=%2x\n",chan,v&0x20);
/*if (CH->sus!=(v&0x20))
logerror("chan=%i sus=%2x\n",chan,v&0x20);*/
CH->sus = v & 0x20;
}
@ -2102,7 +2102,7 @@ void * ym2413_get_inst0(void *_chip)
void ym2413_set_mask(void *_chip, UINT32 mask)
{
YM2413 *chip = (YM2413 *)_chip;
chip->mask = mask;
}
YM2413 *chip = (YM2413 *)_chip;
chip->mask = mask;
}

View File

@ -60,18 +60,18 @@
** YM2610/B OPNB
** Y8950 MSX AUDIO
**
*/
#include "ymdeltat.h"
#ifndef INLINE
#define INLINE __inline
#endif
#ifndef logerror
#define logerror (void)
#endif
#define YM_DELTAT_DELTA_MAX (24576)
#define YM_DELTAT_DELTA_MIN (127)
*/
#include "ymdeltat.h"
#ifndef INLINE
#define INLINE __inline
#endif
#ifndef logerror
#define logerror (void)
#endif
#define YM_DELTAT_DELTA_MAX (24576)
#define YM_DELTAT_DELTA_MIN (127)
#define YM_DELTAT_DELTA_DEF (127)
#define YM_DELTAT_DECODE_RANGE 32768
@ -231,7 +231,7 @@ value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning:
/* if yes, then let's check if ADPCM memory is mapped and big enough */
if(DELTAT->memory == 0)
{
logerror("YM Delta-T ADPCM rom not mapped\n");
/*logerror("YM Delta-T ADPCM rom not mapped\n");*/
DELTAT->portstate = 0x00;
DELTAT->PCM_BSY = 0;
}
@ -239,12 +239,12 @@ value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning:
{
if( DELTAT->end >= DELTAT->memory_size ) /* Check End in Range */
{
logerror("YM Delta-T ADPCM end out of range: $%08x\n", DELTAT->end);
/*logerror("YM Delta-T ADPCM end out of range: $%08x\n", DELTAT->end);*/
DELTAT->end = DELTAT->memory_size - 1;
}
if( DELTAT->start >= DELTAT->memory_size ) /* Check Start in Range */
{
logerror("YM Delta-T ADPCM start out of range: $%08x\n", DELTAT->start);
/*logerror("YM Delta-T ADPCM start out of range: $%08x\n", DELTAT->start);*/
DELTAT->portstate = 0x00;
DELTAT->PCM_BSY = 0;
}

View File

@ -1120,7 +1120,7 @@ static void write_to_register(ymz280b_state *chip, int data)
case 0x80: // d0-2: DSP Rch, d3: enable Rch (0: yes, 1: no), d4-6: DSP Lch, d7: enable Lch (0: yes, 1: no)
case 0x81: // d0: enable control of $82 (0: yes, 1: no)
case 0x82: // DSP data
logerror("YMZ280B: DSP register write %02X = %02X\n", chip->current_register, data);
/*logerror("YMZ280B: DSP register write %02X = %02X\n", chip->current_register, data);*/
break;
case 0x84: /* ROM readback / RAM write (high) */