[VM][FM7] Fix correct clock changing.
emit sig_sound_device(this->getValue1());
}
+void Object_Menu_Control_7::do_set_cyclesteal(bool flag)
+{
+ if(flag) {
+ config.dipswitch = config.dipswitch | 0x0001;
+ } else {
+ config.dipswitch = config.dipswitch & ~0x0001;
+ }
+ if(emu) {
+ emu->LockVM();
+ emu->update_config();
+ emu->UnlockVM();
+ }
+
+}
+
Action_Control_7::Action_Control_7(QObject *parent) : Action_Control(parent)
{
fm7_binds = new Object_Menu_Control_7(parent);
actionBootMode[1]->setText(QString::fromUtf8("DOS"));
actionBootMode[2]->setText(QString::fromUtf8("MMR"));
+ actionCycleSteal->setText(QString::fromUtf8("Cycle Steal"));
menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Boards", 0, QApplication::UnicodeUTF8));
#if defined(_FM77AV_VARIANTS)
actionSoundDevice[0]->setVisible(false);
this, SLOT(do_set_sound_device(int)));
}
}
+
+ actionCycleSteal = new Action_Control_7(this);
+ menuMachine->addAction(actionCycleSteal);
+ actionCycleSteal->setCheckable(true);
+ actionCycleSteal->setVisible(true);
+ if((config.dipswitch & 0x01) == 0x01) actionCycleSteal->setChecked(true);
+ connect(actionCycleSteal, SIGNAL(toggled(bool)),
+ actionCycleSteal->fm7_binds, SLOT(do_set_cyclesteal(bool)));
}
int sig_sound_device(int);
public slots:
void do_set_sound_device(void);
+ void do_set_cyclesteal(bool flag);
};
class Action_Control_7 : public Action_Control
QActionGroup *actionGroup_SoundDevice;
QMenu *menuSoundDevice;
class Action_Control_7 *actionSoundDevice[8]; //
+ class Action_Control_7 *actionCycleSteal;
void setupUI_Emu(void);
void retranslateUi(void);
public:
// subcpu->reset();
}
+void DISPLAY::update_config(void)
+{
+ set_cyclesteal(config.dipswitch & 0x01); // CYCLE STEAL = bit0.
+}
+
void DISPLAY::draw_screen(void)
{
int y;
// SUB:D405:W
void DISPLAY::set_cyclesteal(uint8 val)
{
-#if !defined(_FM7) && !defined(_FMNEW7) && !defined(_FM8)
+#if !defined(_FM8)
val &= 0x01;
if(val != 0) {
is_cyclesteal = true;
event->set_lines_per_frame(400);
event->set_context_cpu(dummycpu, 8000000);
#if defined(_FM8)
- event->set_context_cpu(maincpu, 1095000);
- event->set_context_cpu(subcpu, 999000);
+ event->set_context_cpu(maincpu, MAINCLOCK_SLOW);
+ event->set_context_cpu(subcpu, SUBCLOCK_SLOW);
#else
- event->set_context_cpu(maincpu, 1794000);
- event->set_context_cpu(subcpu, 2000000);
+ if(config.cpu_type == 0) {
+ // 2MHz
+ event->set_context_cpu(maincpu, MAINCLOCK_NORMAL);
+ event->set_context_cpu(subcpu, SUBCLOCK_NORMAL);
+ } else {
+ // 1.2MHz
+ event->set_context_cpu(maincpu, MAINCLOCK_SLOW);
+ event->set_context_cpu(subcpu, SUBCLOCK_SLOW);
+ }
#endif
#ifdef WITH_Z80
event->set_context_cpu(z80cpu, 4000000);
void VM::update_config()
{
+#if !defined(_FM8)
+ switch(config.cpu_type){
+ case 0:
+ event->set_cpu_clock(maincpu, MAINCLOCK_NORMAL);
+ event->set_cpu_clock(subcpu, SUBCLOCK_NORMAL);
+ break;
+ case 1:
+ event->set_cpu_clock(maincpu, MAINCLOCK_SLOW);
+ event->set_cpu_clock(subcpu, SUBCLOCK_SLOW);
+ break;
+ }
+#endif
for(DEVICE* device = first_device; device; device = device->next_device) {
device->update_config();
}
#define MAX_DRIVE 4
#define HAS_MC6809
#define MB8877_MAX_CHIPS 1
-#define MEMORY_ADDR_MAX 0x10000
-#define MEMORY_BANK_SIZE 0x1000
//#define IO_ADDR_MAX 0x10000
// device informations for win32
#define FM7_BOOTMODE_ROM4 3
#define FM7_BOOTMODE_RAM 4
+#define MAINCLOCK_NORMAL 1794000
+#define MAINCLOCK_MMR 1565000
+#define MAINCYCLES_FAST_MMR 2016000
+#define MAINCLOCK_SLOW 1095000
+
+#define SUBCLOCK_NORMAL 2000000
+#define SUBCLOCK_SLOW 999000
+
+
#define FM7_SUBMEM_OFFSET_DPALETTE 0x100000
#define FM7_SUBMEM_OFFSET_APALETTE_B 0x200000
#define FM7_SUBMEM_OFFSET_APALETTE_R 0x300000
void write_data8(uint32 addr, uint32 data);
void initialize(void);
void reset(void);
+ void update_config(void);
void draw_screen(void);
void event_frame(void);