** Qt porting and FM-7/77/AV/AV40/EX for Common Source Code Project **

                                                       March 03, 2020
                            K.Ohta  (whatisthis.sowhat _at_ gmail.com)

1.About

This package is Qt5 porting of Common Source Code Project (CSP)
and built with Qt5, for Windows, built with MinGW(32bit).

Source Code:

   https://github.com/Artanejp/common_source_project-fm7/releases/tag/SNAPSHOT_20200303
   
Additional INFO:

   Binaries will be available, distibute from osdn.net.
   
   See, https://osdn.net/projects/csp-qt/  and
        https://osdn.net/projects/csp-qt/releases/ .
	
   Released at:


2.Background

Common Source Code Project (CSP) is good emulator writing.
It also distributed with GPLv2, this is good for me.

But codes are specified to M$ Visual C.
I'm using GNU/Linux, and I starting to apply FM-7(or later).

So, I start to port to GNU/Linux and using Qt4/Qt5.

What you need at least:

a. Qt5 (neither Qt3 and Qt4) toolkit: Qt5.3 or later.

b. Some OpenGL implementation, maybe at leaset OpenGL v2.x .

c. gcc / g++ (5.0 or later? ) or llvm clang / clang++ (3.5 or later?) toolchain.

d. SDL2 (not SDL1.x).

e. CMake 2.8 or later.

f. Needs ffmpeg.See https://ffmpeg.org/ .

g. FFMpeg has bundled only for Win32.Please install for other OSs if not working.

h. Built with Qt5.5 (for Ubuntu 16.04LTS) or Qt 5.10 (for Win32 and Debian/Sid).

i. Now, changed default drawing infrastructure to OpenGL ES2.You can change --opengl option via comman line (or GUI).

j. Now for Win32 build, using LLVM CLANG cross toolchains on Docker environment.Because exception handling of MinGW-w64's gcc is very slowly (this cause by *evil* Borland).
  See https://github.com/Artanejp/llvm-mingw and https://hub.docker.com/r/artanejp/llvm-mingw64-ubuntu-cosmic for datails.
  
* TIPS: If emufoo.exe don't show screen drawing, set environment variable QT_OPENGL to software (i.e. Using Windows as VirtualBox's gueat OS).

3.How to build:

After extracting (or git pulled) sourcecodes:

$ cd {srctop}/source/build-cmake/{Machine name}/

$ mkdir build

$ cd build

To configure:

$ cmake ..

or

$ ccmake ..

To build:

$ make

To install:

$ sudo make install

4.Qt specified notice:
   
   ・Config file (scancode.cfg and foo.ini) has placed (moved) to
     "~/.config/CommonSourceCodeProject/emufoo/"
     (for Windows, ".\CommonSourceCodeProject\emudfoo\" ).
   
   ・BIOS, WAVS, BINS and SAVED STATES have placed (moved) to
     "~/CommonSourceCodeProject/emufoo/"
     (for Windows, ".\CommonSourceCodeProject\emudfoo\" ).
   
   ・All of recorded products (PNG Screenshots, MOVIES, SOUNDS) 
     have *temporally* written to "~/.config/CommonSourceCodeProject/emufoo/"
     (for Windows, ".\CommonSourceCodeProject\emudfoo\" ).
   
   ・Added ToolTips and Japanese translations.(2017-01-24)
   
   ・Place R@Ms under $HOME/CommonSourceCodeProject/emu{Machine Name}/ , this directory has made
     after first using.
   
   ・Config file, {foo}.ini is written on $HOME/.config/CommonSourceCodeProject/emu{Machine Name}/ .
   
   ・Saved state file, {foo}.sta is written on $HOME/CommonSourceCodeProject/emu{Machine Name}/ .
   
   ・Key code conversion file is written on $HOME/.config/CommonSourceCodeProject/emu{Machine Name}/scancode.cfg .
   
     This file contains comma separated fields, written at hex-decimal (not decimal), 
       first is M$ Virtual Key Code,
       second is Qt's scan code.
       
   ・Common UI components (at src/qt/gui ) are moved to shared lib. libCSPgui.so .
   
   ・Installer (bash) script is available now; src/tool/installer_unix.sh .
   
   ・When you place specified WAV files(differ per VM) same directory as ROMs, you can sound sounds: i.e. FDD seek, CMT relay and buttons.
  
5.Status

a. I tested to build only under Debian GNU/Linux "sid",Ubuntu Linux 16.04LTS "Xenial" for AMD64 (x86_64)
and MinGW with GCC6 (Windows 32bit).

   But, perhaps, will succed to build another GNU/Linux OSs or BSD OS variants.
   
   * On windows, using MinGW is already okay, but not tested drawing.
   
   * Cross building with GNU/Linux's MinGW32 and Qt5.5.1 (for MinGW) is available. 
     Modify and use build-cmake/config_build_cross_win32.sh and related *.cmake files.
     
   * And, you can also build with M$ Visual Studio 2013 or 2015.

b. Now, I using Qt5 as toolkit, because authors of Qt announced "Qt4 is obsolete, will be updated no longer".

c. All of virtual machines are already ported to Qt (On Oct 29, 2015).

d. Now using GCC-6.1 with Link Time Optimize to build for distrubuted binaries.

e. Implemented socket, networking for MZ-2500, but, not tested yet (；´Д｀)

Repositry:

   https://github.com/Artanejp/common_source_project-fm7

   https://osdn.net/projects/csp-qt/scm/git/common_source_project-fm7


Project Page:

   https://osdn.jp/projects/csp-qt/

Upstream (Takeda Toshiya San's original code):

   http://takeda-toshiya.my.coocan.jp/

Special thanks to:
   Ryu Takegami-san, to assist debugging FM-7/77/AV/40/EX .
   Haserin-san, to assist debugging FM-7/77/AV/40/EX .
   Developers of Ootake, give hints of emuPCEngine (from source code).
   
Changes:

* To see older changes, read ChangeLog and 000_gitlog.txt.

* SNAPSHOT March 03, 2020
 * Upstream 2020-02-21.
 * [VM/FMTOWNS] Work initially.
                See STATUS section for doc/VMs/fmtowns.txt and
		000_gitlog.txt .
 * [VM/I386_NP21] Merge Upstream 2020-02-21 's I386::/NP21.Belows are differ from upstream:
      - Implement memory wait to change CPU speed.
      - Implement extra reset wire to notify CPU reset.
      - Some headers are changed due to cause FTBFS with GCC.
      - Character encoding chenged to UTF-8 at most of source files(not all?)
 * [VM/I386] IMPORTANT: libcpu_newdev/i386 has removed.I386:: porting from NP21 seems to be working nice, no need to porting from MAME/C++.
 * [UI/Qt] Add HARDDISK CREATION feature.
 * [VM/HARDDISK] Calculate correctness C/H/S of HDD.
 * [VM/SCSI_HDD][WIP] Implement RECALIBRATE SCSI command.
 * [VM/SCSI_HDD][VM/SCSI_DEV] Implement some command.But still not active.
 * [VM/BMJr] Fix Break sequence. Thanks to https://matsuri.5ch.net/test/read.cgi/i4004/1526806551/648 .
 * [VM/BMJr] Fix reset-key (EIKIGOU + BREAK) sequence.
 * [VM/BMJr] Alse assume Back Space key to DELETE key.
 * [VM/BMJr] Also assume Esc key to BREAK key.
 * [VM/FMGEN] Initial implemantation of YM2612 (OPN2).
 * [VM/UPD71071] Make some functions make virtual to prepare overwrap by TOWNS_DMAC.
 * [VM/DEVICE] Add update_signal_mask() to modify signal mask for SIG_SCSI_DAT for SCSI/SASI devices.
 * [VM/COMMON_VM] Include SCSI devices to libCSPcommon_vm, excepts SCSI_HOST::.
 * [VM/PCENGINE] ADPCM: Fix em-bugged freeze ADPCM DMA after CDC STATUS (write to I/O 1800h.)
 * [VM/PC9801] 86PCM: Fix Initial value of PCM_MUTE(A66Eh).Adjust volume multiply factor.
 * [BUILD/Windows] LLVM: Update Qt version to 5.14.
 * [VM/PC9801] DISPLAY: Re-Backport from Upstream 2020-02-01.Kakinoki Syougi works fine.
 * [VM/SCSI_CDROM] Fix freeze some PC-Engine's CD-ROM^2 games and SCSI HDD for FM-Towns.
 * [Qt/OpenGL_ES] Win32: Fix shader compilation errors with Angle Project.
 * [Qt/OpenGL] Correctness texture magnitude calculating.
 * [UI/Qt] Win32: Fix closing D77/D88 image when select another slot.
 * [UI/Qt] Harddisk: Add *.h0-*.h9 , they are Unz (Towns emulator)'s virtual harddisk images.
 * [OSD/SOUND] Fix crash when effective sound sink don't exists.
 * [Qt/OpenGL] Fix FTBFS if don't have libglu.
 * [UI/Qt] Add "USE_CUSTOM_SCREEN_ZOOM_FACTOR" flag to fooVM.h.
 * [UI/Qt] Try: Make GUI core (QApplication -> QCoreApplication) to be non-Global.
   Thanks to https://matsuri.5ch.net/test/read.cgi/i4004/1526806551/719 .
 * Built with 177db8ccb3765bf7f49ef3d9f25738bb15348e2b (or later).

-- Mar 03, 2020 15:13:25 +0900 K.Ohta <whatisthis.sowhat@gmail.com>

Upstream changes:
* To see older upstream's changes, read history.txt.

2/21/2020

[VM/I386_NP21] update to Neko Project 21/W ver0.86 rev71 beta4

[PC9801VX] support to switch cpu mode to V30

[PC9801RA] support to switch cpu mode to V30


2/17/2020

[EMU] add is_floppy_disk_connected() and is_quick_disk_connected()

[WINMAIN] disable floppy/quick disk drive menus when drives are disconnected

[VM/I8080] improve disassembler to distinguish 8080 and 8085

[VM/I86] split i86/i88/i186/v30 from I286 class

[VM/I86] fix aam in v30

[VM/I86] support 8080 emulation mode in V30

[VM/I386_NP21] improve not to explicitly accept irq while executing opecode

[VM/I386_DASM] split i386 disassembler from I286/I386 class

[VM/V30_DASM] split v30 disassembler from I286 class

[VM/V30_DASM] add 8080 disassebler for 8080 emulation mode

[VM/VM_TEMPLATE] add is_floppy_disk_connected() and is_quick_disk_connected()

[PC9801] support to enable/disable 1MB/640K/320KB-FDD interfaces


2/1/2020

[EMU] support to create blank hard disk image (*.hdi/*.nhd)

[WINMAIN] add menu items to mount blank hard disk image

[VM/DEVICE] improve memory/io bus interfaces for 16/32bit access

[VM/DEVICE] add get_event_clocks() and get_cpu_clocks()

[VM/EVENT] add get_event_clocks() and get_cpu_clocks()

[VM/I386_NP21] support 80386 (based on Neko Project 21/W i386 core)

[VM/I8259] make update_intr() public

[VM/MEMORY] improve memory bus interfaces for 16/32bit access

[VM/MEMORY] make rd_table/wr_table/addr_shift public

[VM/UPD7220] fix stop command (thanks Neko Project 21/W)

[FMR50] change i386 core from MAME to Neko Project 21/W

[FMR50] support to mount blank hard disk image

[MZ2500] support to mount blank hard disk image

[MZ2800] support to mount blank hard disk image

[PC9801] change i386 core from MAME to Neko Project 21/W

[PC9801] support to mount blank hard disk image

[PC9801/DISPLAY] improve code for big-endian host machine

[PC9801/FMSOUND] support 86-type PCM (thanks Neko Project 21/W)

[PC9801/MEMBUS] improve memory bus interfaces for 16/32bit access

[PC9801/MOUSE] fix irq number in hireso mode

[PC9801/SASI] improve irq/drq signals to generate from sasi bus signals

[X1TURBO] support to mount blank hard disk image

[X1TURBO/IOBUS] fix not to clear vram in reset()


1/23/2020

[VM/Z80DMA] fix byte counter read by read mask follows command (thanks Mr.Sato)

-----


Have fun!
-- Ohta.

