message("* vm/fm-towns")
-add_library(vm_fmtowns
-
+set(VM_FMTOWNS_DEV_SRCS
ad7820kr.cpp
rf5c68.cpp
adpcm.cpp
+ cdc.cpp
floppy.cpp
keyboard.cpp
scsi.cpp
timer.cpp
-
- serialrom.cpp
- towns_sysrom.cpp
- towns_dictionary.cpp
- msdosrom.cpp
+ towns_dmac.cpp
fontroms.cpp
+ msdosrom.cpp
+ serialrom.cpp
+ townd_dictionary.cpp
+ towns_cdrom.cpp
towns_crtc.cpp
towns_memory.cpp
towns_sprite.cpp
+ towns_sysrom.cpp
towns_vram.cpp
+
+ fmtowns.cpp
)
+
+if(BUILD_WITH_20PIX)
+ set(VM_FMTOWNS_DEV_SRCS ${VM_FMTOWNS_DEV_SRCS} fontrom_20pix.cpp)
+endif()
+
+add_library(vm_fmtowns
+ ${VM_FMTOWNS_DEV_SRCS}
+)
if(event_adpcm_clock >= 0) {
cancel_event(this, event_adpcm_clock);
}
- register_event(this, EVENT_ADPCM_CLOCK, 16.0e6 / (384.0 * 2.0), true, &event_adpcm_clock); // Is this true?
+ // Tick is (8.0e6 / 384.0)[Hz] .. Is this true?
+ register_event(this, EVENT_ADPCM_CLOCK, 1.0e6 / (16.0 / (384.0 * 2.0)), true, &event_adpcm_clock);
}
void ADPCM::initialize_adc_clock(int freq)
case 0xd5:
opn2_mute = ((data & 0x02) == 0) ? true : false;
adpcm_mute = ((data & 0x01) == 0) ? true : false;
- //d_opn2->write_signal(SIG_YM2612_MUTE, (opn2_mute) ? 0xffffffff : 0x00000000, 0xffffffff);
+ d_opn2->write_signal(SIG_YM2612_MUTE, (opn2_mute) ? 0xffffffff : 0x00000000, 0xffffffff);
d_rf5c68->write_signal(SIG_RF5C68_MUTE, (adpcm_mute) ? 0xffffffff : 0x00000000, 0xffffffff);
break;
case 0xe8:
initialize_output_signals(&outputs_intr);
initialize_output_signals(&outputs_led_control);
initialize_output_signals(&outputs_allmute);
+ d_rf5c68 = NULL;
+ d_opn2 = NULL;
+ d_pic = NULL;
+ d_adc = NULL;
+
for(int i = 0; i < 8; i++) {
dac_intr[i] = false;
dac_intr_mask[i] = true;
class SCSI_HOST;
class FIFO;
-namespace TOWNS {
+namespace FMTOWNS {
class TOWNS_CDROM;
}
-namespace TOWNS {
+namespace FMTOWNS {
class CDC : public DEVICE {
protected:
outputs_t output_dma_line;
#include "floppy.h"
#include "../i8259.h"
#include "../mb8877.h"
-
+namespace FMTOWNS {
void FLOPPY::initialize()
{
drvreg = drvsel = 0;
state_fio->Fread(changed, sizeof(changed), 1);
return true;
}
-
+}
class MB8877;
+namespace FMTOWNS {
class FLOPPY : public DEVICE
{
private:
changed[drv] = true;
}
};
+}
#endif
#include "../scsi_host.h"
#include "../upd71071.h"
+#include "towns_cdrom.h"
#include "towns_crtc.h"
+#include "towns_dictionary.h"
+#include "towns_dmac.h"
+#include "towns_memory.h"
+#include "towns_sprite.h"
+#include "towns_sysrom.h"
+#include "towns_vram.h"
// Electric Volume
//#include "mb87078.h"
//YM-2612 "OPN2"
#include "../debugger.h"
#endif
-#include "cmos.h"
-#include "floppy.h"
-#include "keyboard.h"
-#include "memory.h"
-#include "scsi.h"
-//#include "serial.h"
-#include "timer.h"
+#include "./floppy.h"
+#include "./keyboard.h"
+#include "./msdosrom.h"
+#include "./scsi.h"
+#include "./serialrom.h"
+#include "./timer.h"
// ----------------------------------------------------------------------------
// initialize
// ----------------------------------------------------------------------------
+using FMTOWNS::ADPCM;
+using FMTOWNS::CDC;
+using FMTOWNS::DICTIONARY;
+using FMTOWNS::FLOPPY;
+using FMTOWNS::FONT_ROMS;
+using FMTOWNS::KEYBOARD;
+using FMTOWNS::MSDOSROM;
+using FMTOWNS::SCSI;
+using FMTOWNS::SERIAL_ROM;
+using FMTOWNS::SYSROM;
+using FMTOWNS::TIMER;
+
+using FMTOWNS::TOWNS_CDROM;
+using FMTOWNS::TOWNS_CRTC;
+using FMTOWNS::TOWNS_DMAC;
+using FMTOWNS::TOWNS_MEMORY;
+using FMTOWNS::TOWNS_SPRITE;
+using FMTOWNS::TOWNS_VRAM;
+
VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
{
// init sound gen
beep->initialize_sound(rate, 8000);
+ // init OPN2
+ opn2->initialize_sound(rate, 1.0e6 / (16.0 / (384.0 * 2.0)), samples, 0.0, 0.0);
+
+ // init PCM
+ rf5c68->initialize_sound(rate, samples);
+
// add_sound_in_source() must add after per initialize_sound().
adc_in_ch = event->add_sound_in_source(rate, samples, 2);
mixer->set_context_out_line(adc_in_ch);
#include "../i8259.h"
#include "../../fifo.h"
+namespace FMTOWNS {
void KEYBOARD::initialize()
{
key_buf = new FIFO(64);
state_fio->Fread(table, sizeof(table), 1);
return true;
}
+}
#include "../device.h"
/*
- \82Ð\82ç\82ª\82È/\83\8d\81[\83}\8e\9a \82Ð\82ç\82ª\82È
- \94¼\8ap/\91S\8ap \94¼\8ap/\91S\8ap
- \95Ï\8a· \95Ï\8a·
- \96³\95Ï\8a· \96³\95Ï\8a·
- \82©\82È/\8a¿\8e\9a
- \83J\83^\83J\83i
- \91O\8ds PgUp
- \8e\9f\8ds PgDn
- \8eÀ\8ds F12
- \8eæ\8fÁ F11
+ ひらがな/ローマ字 ひらがな
+ 半角/全角 半角/全角
+ 変換 変換
+ 無変換 無変換
+ かな/漢字
+ カタカナ
+ 前行 PgUp
+ 次行 PgDn
+ 実行 F12
+ 取消 F11
COPY
*/
+namespace FMTOWNS {
static const int key_table[256] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10,0x00,0x00,0x00,0x1D,0x00,0x00,
0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
+}
class FIFO;
+namespace FMTOWNS {
class KEYBOARD : public DEVICE
{
private:
void key_down(int code);
void key_up(int code);
};
+}
#endif
event_dac_sample = -1;
}
if(mix_rate > 0) {
+ // TOWNS::ADPCM::event_callback() -> SIG_RF5C68_DAC_PERIOD(=DRIVE CLOCK from VM)
+ // -> RF5C68::event_callback()(=AUDIO MIXING CLOCK by EMU)
+ // -> RF5C68::mix() -> OSD::SOUND
sample_tick_us = 1.0e6 / ((double)mix_rate);
register_event(this, EVENT_DAC_SAMPLE, sample_tick_us, true, &event_dac_sample);
}
#define STATUS_INT 0x02
#define STATUS_PERR 0x01
+namespace FMTOWNS {
+
void SCSI::reset()
{
ctrl_reg = CTRL_IMSK;
irq_status = state_fio->FgetBool();
return true;
}
-
+}
#define SIG_SCSI_IRQ 0
#define SIG_SCSI_DRQ 1
+namespace FMTOWNS {
class SCSI : public DEVICE
{
private:
void save_state(FILEIO* state_fio);
bool load_state(FILEIO* state_fio);
};
+}
#endif
[ timer ]
*/
-#include "timer.h"
+#include "./timer.h"
#include "../i8259.h"
#include "../msm58321.h"
#include "../pcm1bit.h"
+namespace FMTOWNS {
+
void TIMER::initialize()
{
free_run_counter = 0;
return true;
}
+}
+
#define SIG_TIMER_CH1 1
#define SIG_TIMER_RTC 2
+namespace FMTOWNS {
class TIMER : public DEVICE
{
private:
d_rtc = device;
}
};
+}
#endif
switch(command[0]) {
case TOWNS_CDROM_CDDA_PLAY:
play_cdda_from_cmd();
- return;
break;
case TOWNS_CDROM_CDDA_PAUSE:
pause_cdda_from_cmd();
- return;
break;
case TOWNS_CDROM_CDDA_UNPAUSE:
unpause_cdda_from_cmd();
- return;
break;
case TOWNS_CDROM_CDDA_STOP:
stop_cdda_from_cmd();
- return;
break;
case SCSI_CMD_TST_U_RDY:
case SCSI_CMD_INQUIRY:
case SCSI_CMD_READ12:
SCSI_CDROM::start_command();
set_subq(); // First
- return;
break;
case 0xff:
// End of List
set_dat(SCSI_STATUS_CHKCOND);
- return;
break;
default:
#ifdef _SCSI_DEBUG_LOG
set_subq();
}
-
-
void TOWNS_CDROM::play_cdda_from_cmd()
{
uint8_t m_start = command[3];
#define TOWNS_CDROM_CDDA_UNPAUSE 0xf2
#define TOWNS_CDROM_CDDA_STOP 0xf3
-
class SCSI_HOST;
class FIFO;
class FILEIO;