pthread_mutex_t mutex;
int isAtexit;
AudioDeviceID outputDeviceID;
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+ AudioDeviceIOProcID ioProcID;
+#endif
UInt32 audioDevicePropertyBufferFrameSize;
AudioStreamBasicDescription outputStreamBasicDescription;
int live;
static void coreaudio_logstatus (OSStatus status)
{
- char *str = "BUG";
+ const char *str = "BUG";
switch(status) {
case kAudioHardwareNoError:
break;
default:
- AUD_log (AUDIO_CAP, "Reason: status code %ld\n", status);
+ AUD_log (AUDIO_CAP, "Reason: status code %d\n", status);
return;
}
&core->audioDevicePropertyBufferFrameSize);
if (status != kAudioHardwareNoError) {
coreaudio_logerr2 (status, typ,
- "Could not set device buffer frame size %ld\n",
+ "Could not set device buffer frame size %d\n",
core->audioDevicePropertyBufferFrameSize);
return -1;
}
}
/* set Callback */
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+ status = AudioDeviceCreateIOProcID(core->outputDeviceID,
+ audioDeviceIOProc,
+ hw,
+ &core->ioProcID);
+#else
status = AudioDeviceAddIOProc(core->outputDeviceID, audioDeviceIOProc, hw);
+#endif
if (status != kAudioHardwareNoError) {
coreaudio_logerr2 (status, typ, "Could not set IOProc\n");
core->outputDeviceID = kAudioDeviceUnknown;
status = AudioDeviceStart(core->outputDeviceID, audioDeviceIOProc);
if (status != kAudioHardwareNoError) {
coreaudio_logerr2 (status, typ, "Could not start playback\n");
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+ AudioDeviceDestroyIOProcID(core->outputDeviceID, core->ioProcID);
+#else
AudioDeviceRemoveIOProc(core->outputDeviceID, audioDeviceIOProc);
+#endif
core->outputDeviceID = kAudioDeviceUnknown;
return -1;
}
}
/* remove callback */
+#if defined(MAC_OS_X_VERSION_10_5) && (MAC_OS_X_VERSION_MIN_REQUIRED>=MAC_OS_X_VERSION_10_5)
+ status = AudioDeviceDestroyIOProcID(core->outputDeviceID,
+ core->ioProcID);
+#else
status = AudioDeviceRemoveIOProc(core->outputDeviceID,
audioDeviceIOProc);
+#endif
if (status != kAudioHardwareNoError) {
coreaudio_logerr (status, "Could not remove IOProc\n");
}
case 0x0b10: return s->cm_iclken_sgx;
case 0x0b20: return s->cm_idlest_sgx & 0x0;
case 0x0b40: return s->cm_clksel_sgx;
+ case 0x0b44: return s->cm_sleepdep_sgx;
case 0x0b48: return s->cm_clkstctrl_sgx;
case 0x0b4c: return s->cm_clkstst_sgx;
/* WKUP_CM */
case 0xb00: s->cm_fclken_sgx = value & 0x2; break;
case 0xb10: s->cm_iclken_sgx = value & 0x1; break;
case 0xb40: s->cm_clksel_sgx = value; break; /* TODO: SGX clock */
- case 0xb44: s->cm_sleepdep_sgx = value &0x2; break;
+ case 0xb44: s->cm_sleepdep_sgx = value & 0x2; break;
case 0xb48: s->cm_clkstctrl_sgx = value & 0x3; break;
/* WKUP_CM */
case 0xc00:
static void glue(omap3_lcd_panel_draw_line16_, DEPTH)(PIXEL_TYPE *dest,
- const uint16_t *src, unsigned int width)
+ const uint16_t *src,
+ unsigned int width)
{
#if !defined(SWAP_WORDS) && DEPTH == 16
memcpy(dest, src, width);
#endif
}
-/*
-LCD: 0x4: RGB 12
- 0x5: ARGB16
- 0x6: RGB 16
- 0x8: RGB 24 (un-packed in 32-bit container)
- 0x9: RGB 24 (packed in 24-bit container)
- 0xc: ARGB32
- 0xd: RGBA32
- 0xe: RGBx 32 (24-bit RGB aligned on MSB of the 32-bit container)
-
-SDL: 8/16/24/32
+static void glue(omap3_lcd_panel_draw_line24a_, DEPTH)(PIXEL_TYPE *dest,
+ const uint8_t *src,
+ unsigned int width)
+{
+#if !defined(SWAP_WORDS) && DEPTH == 32
+ memcpy(dest, src, width);
+#else
+ unsigned int r, g, b;
+ const uint8_t *end = (const void *) src + width;
+ while (src < end) {
+ b = *(src++);
+ g = *(src++);
+ r = *(src++);
+ src++;
+ COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
+ }
+#endif
+}
-*/
+static void glue(omap3_lcd_panel_draw_line24b_, DEPTH)(PIXEL_TYPE *dest,
+ const uint8_t *src,
+ unsigned int width)
+{
+#if DEPTH == 24
+ memcpy(dest, src, width);
+#else
+ unsigned int r, g, b;
+ const uint8_t *end = (const void *) src + width;
+ while (src < end) {
+ b = *(src++);
+ g = *(src++);
+ r = *(src++);
+ COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
+ }
+#endif
+}
/* No rotation */
static omap3_lcd_panel_fn_t glue(omap3_lcd_panel_draw_fn_, DEPTH)[0x10] = {
- NULL, /*0x0*/
- NULL, /*0x1*/
- NULL, /*0x2*/
- NULL, /*0x3*/
- NULL, /*0x4:RGB 12 */
- NULL, /*0x5: ARGB16 */
- (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line16_, DEPTH), /*0x6: RGB 16 */
- NULL, /*0x7*/
- NULL, /*0x8: RGB 24 (un-packed in 32-bit container) */
- NULL, /*0x9: RGB 24 (packed in 24-bit container) */
- NULL, /*0xa */
- NULL, /*0xb */
- NULL, /*0xc: ARGB32 */
- NULL, /*0xd: RGBA32 */
- NULL, /*0xe: RGBx 32 (24-bit RGB aligned on MSB of the 32-bit container) */
- NULL, /*0xf */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line16_, DEPTH),
+ NULL,
+ (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line24a_, DEPTH),
+ (omap3_lcd_panel_fn_t)glue(omap3_lcd_panel_draw_line24b_, DEPTH),
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
};
/* 90deg, 180deg and 270deg rotation */
#include "devices.h"
#include "hw.h"
+#define OMAP3_HSUSB_OTG
+//#define OMAP3_HSUSB_HOST
+
#define OMAP3_HSUSB_DEBUG
#ifdef OMAP3_HSUSB_DEBUG
#define TRACE(...)
#endif
+#ifdef OMAP3_HSUSB_OTG
/* usb-musb.c */
extern CPUReadMemoryFunc *musb_read[];
extern CPUWriteMemoryFunc *musb_write[];
omap3_hsusb_otg_load_state,
s);
}
+#endif
+#ifdef OMAP3_HSUSB_HOST
struct omap3_hsusb_host_s {
qemu_irq ehci_irq;
qemu_irq tll_irq;
omap3_hsusb_host_save_state,
omap3_hsusb_host_load_state, s);
}
+#endif
struct omap3_hsusb_s {
+#ifdef OMAP3_HSUSB_OTG
struct omap3_hsusb_otg_s otg;
+#endif
+#ifdef OMAP3_HSUSB_HOST
struct omap3_hsusb_host_s host;
+#endif
};
struct omap3_hsusb_s *omap3_hsusb_init(struct omap_target_agent_s *otg_ta,
qemu_irq tll_irq)
{
struct omap3_hsusb_s *s = qemu_mallocz(sizeof(struct omap3_hsusb_s));
- /* NOTE: init host controller first and OTG controller last in order to
- * make qemu put the attached usb devices on a hub connected to the OTG */
+#ifdef OMAP3_HSUSB_HOST
omap3_hsusb_host_init(host_ta, tll_ta,
ohci_irq, ehci_irq, tll_irq,
&s->host);
+#endif
+#ifdef OMAP3_HSUSB_OTG
omap3_hsusb_otg_init(otg_ta, mc_irq, dma_irq, &s->otg);
+#endif
return s;
}
0, /* 0x7: reserved */
4, /* 0x8: RGB24 (unpacked in 32-bit container) */
3, /* 0x9: RGB24 (packed in 24-bit container) */
- 0, /* 0xa: reserved */
- 0, /* 0xb: reserved */
+ 2, /* 0xa: YUV2 422 */
+ 2, /* 0xb: UYVY 422 */
4, /* 0xc: ARGB32 */
4, /* 0xd: RGBA32 */
4, /* 0xe: RGBx32 (24-bit RGB aligned on MSB of the 32-bit container) */
exit(1);
}
if (!s->line_fn) {
- fprintf(stderr, "%s:s->line_fn is NULL. Not supported gfx_format \n", __FUNCTION__);
+ fprintf(stderr,
+ "%s: line_fn is NULL - unsupported gfx_format (%d)\n",
+ __FUNCTION__, dss->dispc.l[0].gfx_format);
exit(1);
}
if (lcd_width != ds_get_width(s->state)