cs4231a.c (3c825bb7c1b4289ef05f51b5b77ac0967b6a27fa) | cs4231a.c (85bc58520c0e43660cbbe51b9eb5022a0baafe9f) |
---|---|
1/* 2 * QEMU Crystal CS4231 audio chip emulation 3 * 4 * Copyright (c) 2006 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 274 unchanged lines hidden (view full) --- 283 } 284 285 as.nchannels = (val & (1 << 4)) ? 2 : 1; 286 as.endianness = 0; 287 s->tab = NULL; 288 289 switch ((val >> 5) & ((s->dregs[MODE_And_ID] & MODE2) ? 7 : 3)) { 290 case 0: | 1/* 2 * QEMU Crystal CS4231 audio chip emulation 3 * 4 * Copyright (c) 2006 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 274 unchanged lines hidden (view full) --- 283 } 284 285 as.nchannels = (val & (1 << 4)) ? 2 : 1; 286 as.endianness = 0; 287 s->tab = NULL; 288 289 switch ((val >> 5) & ((s->dregs[MODE_And_ID] & MODE2) ? 7 : 3)) { 290 case 0: |
291 as.fmt = AUD_FMT_U8; | 291 as.fmt = AUDIO_FORMAT_U8; |
292 s->shift = as.nchannels == 2; 293 break; 294 295 case 1: 296 s->tab = MuLawDecompressTable; 297 goto x_law; 298 case 3: 299 s->tab = ALawDecompressTable; 300 x_law: | 292 s->shift = as.nchannels == 2; 293 break; 294 295 case 1: 296 s->tab = MuLawDecompressTable; 297 goto x_law; 298 case 3: 299 s->tab = ALawDecompressTable; 300 x_law: |
301 as.fmt = AUD_FMT_S16; | 301 as.fmt = AUDIO_FORMAT_S16; |
302 as.endianness = AUDIO_HOST_ENDIANNESS; 303 s->shift = as.nchannels == 2; 304 break; 305 306 case 6: 307 as.endianness = 1; 308 /* fall through */ 309 case 2: | 302 as.endianness = AUDIO_HOST_ENDIANNESS; 303 s->shift = as.nchannels == 2; 304 break; 305 306 case 6: 307 as.endianness = 1; 308 /* fall through */ 309 case 2: |
310 as.fmt = AUD_FMT_S16; | 310 as.fmt = AUDIO_FORMAT_S16; |
311 s->shift = as.nchannels; 312 break; 313 314 case 7: 315 case 4: 316 lerr ("attempt to use reserved format value (%#x)\n", val); 317 goto error; 318 --- 404 unchanged lines hidden --- | 311 s->shift = as.nchannels; 312 break; 313 314 case 7: 315 case 4: 316 lerr ("attempt to use reserved format value (%#x)\n", val); 317 goto error; 318 --- 404 unchanged lines hidden --- |