add_library(vm_vm
${VMFILES}
- device.cpp
)
#define USE_DEVICE_NAME
#endif
+#if defined(USE_DEVICES_SHARED_LIB)
+#include "libcpu_newdev/device.h"
// max devices connected to the output port
#define MAX_OUTPUT 16
#define SIG_SCSI_ACK 309
#define SIG_SCSI_RST 310
-#if defined(USE_DEVICES_SHARED_LIB)
-#include "libcpu_newdev/device.h"
#else
class DEVICE
{
[ event manager ]
*/
-
+#if defined(USE_DEVICES_SHARED_LIB)
+#include "vm.h"
+#include "../emu.h"
+#endif
#include "event.h"
#if defined(_USE_QT)
#include "../qt/gui/csp_logger.h"
for(int i = 0; i < frame_event_count; i++) {
frame_event[i]->event_pre_frame();
}
-
+
// generate clocks per line
if(frames_per_sec != next_frames_per_sec || lines_per_frame != next_lines_per_frame) {
frames_per_sec = next_frames_per_sec;
void EVENT::update_event(int clock)
{
uint64_t event_clocks_tmp = event_clocks + clock;
-
while(first_fire_event != NULL && first_fire_event->expired_clock <= event_clocks_tmp) {
event_t *event_handle = first_fire_event;
uint64_t expired_clock = event_handle->expired_clock;
#ifndef _EVENT_H_
#define _EVENT_H_
+#if defined(USE_DEVICES_SHARED_LIB)
#include "vm.h"
#include "../emu.h"
+#endif
#include "device.h"
#define MAX_CPU 8
lines_per_frame = 0;
next_frames_per_sec = FRAMES_PER_SEC;
next_lines_per_frame = LINES_PER_FRAME;
-
+
#ifdef _DEBUG_LOG
initialize_done = false;
#endif
if(dcount_sound < MAX_SOUND) {
d_sound[dcount_sound++] = device;
}
+ printf("SOUND %d\n", dcount_sound);
}
void touch_sound(void)
{
// Do need mix_sound(remain_samples) before?
if(t_s >= (sound_tmp_samples - buffer_ptr)) t_s = sound_tmp_samples - buffer_ptr - 1;
if(t_s > 0) {
- mix_sound(t_s);
- mix_counter = mix_counter - t_s;
+ mix_sound(t_s);
+ mix_counter = mix_counter - t_s;
}
if(mix_counter < 1) mix_counter = 1;
sound_touched = true;
#ifndef _HD63484_H_
#define _HD63484_H_
-//#include "vm.h"
-//#include "../emu.h"
+#include "vm.h"
+#include "../emu.h"
#include "device.h"
class VM;
#ifndef _I386_H_
#define _I386_H_
-
+#if defined(USE_DEVICES_SHARED_LIB)
+//#if 0
+#include "libcpu_newdev/i386.h"
+#else
#include "vm.h"
#include "../emu.h"
#include "device.h"
void set_shutdown_flag(int shutdown);
int get_shutdown_flag();
};
-
+#endif
#endif
snd_seek_samples_size = dst_size;
break;
case MB8877_SND_TYPE_HEAD: // HEAD
- snd_seek_data = (int16_t *)malloc(alloc_size);
+ snd_head_data = (int16_t *)malloc(alloc_size);
memcpy(snd_head_data, data, utl_size);
strncpy(snd_head_name, pathname, 511);
snd_head_samples_size = dst_size;
if(snd_seek_data != NULL) free(snd_seek_data);
break;
case MB8877_SND_TYPE_HEAD:
- if(snd_seek_data != NULL) free(snd_seek_data);
+ if(snd_head_data != NULL) free(snd_head_data);
break;
default:
return false;
int i, j, k;
int32_t data[2];
int32_t *dst_tmp;
+ if((dst == NULL) || (src == NULL)) return;
+ if((count <= 0) || (samples <= 0)) return;
for(i=0; i < MB8877_SND_TBL_MAX; i++) {
ptr = table[i];
if(ptr >= 0) {