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

                                                       December 16, 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_20201216
   
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).
   Soji Yamakawa-San, author of TOWNS emulater "津軽",
                      and advice for my development a lot.  

Changes:

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

* SNAPSHOT December 16, 2020
  * Upstream 2020-08-16.
  * Important: Build system moved to CMake *perfectly*.See INSTALL.md or INSTALL.en.md.
  * eFM-Towns: Works more softwares.See 00_status_ja.md .
  * [Qt/JOYSTICK] Add mapping gamecontroller settings.
	Read from $CONFIG_DIR/joydb.ini as SDL_GAMECONTROLLER format.
	See https://wiki.libsdl.org/SDL_GameControllerAddMapping .
  * [VM/I386_NP21] Improve CPU registers message.
  * [VM/I386_NP21] Print PC address on PANIC.
  * [VM/DEVICE] Add APIs to DEVICE::; clear_event(), force_register_event(), check_and_update_event() and variants.
  * [VM/FMTOWNS] CDROM: Implement around commands.
  * [VM/FMTOWNS] CDROM: Fix around command 80h (SET STATE).May work RANCE III and SUPER REAL MAHJONG PIV.
  * [VM/FMTOWNS] CDROM: Command A0h: TOWNS_CD_ACCEPT_WAIT must be only after CDROM_COMMAND_STOP_CDDA.
  * [VM/FMTOWNS] CDROM: Reply status immediately with PLAY/PAUSE/UNPAUSE without STATUS BIT (44h/C5h/C7h).
  * [VM/FMTOWNS] CDROM: Maybe working with CCD image.
  * [VM/FMTOWNS] CDROM: Rename delay/status methods to unique name.
  * [VM/FMTOWNS] CDROM: Don't occure duplicated EOT.
  * [VM/FMTOWNS] CDROM: Fix not play CDDA with command SPAM.
  * [VM/FMTOWNS] CDROM: Fix wrong sector size with single track.
  * [VM/FMTOWNS] CDROM: Implement ISO file feature, MODE1/2/RAW read feature.
  * [VM/FMTOWNS] CDROM: Fix wrong response at PAUSE/RESUME CDDA (85h/87h).
  * [VM/FMTOWNS] SPRITE: Fix around zooming and rotating.
  * [VM/FMTOWNS] CRTC: Available to display LOW RESOLUTION.
  * [VM/FMTOWNS] MEMORY: Disable shadow write at F8000h-FFFFFh.
  * [VM/FMTOWNS] MEMORY: Reset memory map when reset from CPU (i.e.Triple fault).
  * [VM/FMTOWNS] SPRITE: Implement correct offset handling and clipping feature.
  * [VM/FMTOWNS] SPRITE: Event driven sprite.
  * [VM/FMTOWNS] VRAM: TRY: Don't wrap around boundary of VRAM (i.e.8107ffff).
  * [VM/UPD71071] eFM-Towns works without SINGLE_MODE_DMA.
  * [VM/UPD71071/TOWNS_DMAC] Add debug message for issues, i.e.Bubble Bobble for FM-Towns.
  * [VM/UPD71071/TOWNS_DMAC] More correctness addressing on R/W.
  * [VM/FM7] DISPLAY: Optimize to be faster.
  * [VM/FM7] DISPLAY: Adjust alignment of some variables.
  * [VM/FM7] MAINMEM: Fix crash at DISPLAY::initialize().
             Seems to break memory at FM7_MAINMEM::initialize().
  * [VM/FM7] MAINMEM: Fixing MEMORY LEAK.
  * [VM/FM7] DISPLAY: Fix not resume digital palette on loading state.
  * [VM/PCM1BIT][COMMON] Fix memory access violation in high-pass/low-pass filter.
  * [VM/MB8877] Fix memory leak on state saving/loading.
  * [VM/COMMON_VM] Move AD78820KR::, RF6C68::, YM2612:: to libCSPcommon_vm.
  * [VM] Make event() and mix() (and some functions) with __FASTCALL.
  * [EMU/Qt] Block execution EMU until prepering GUIs.
  * [EMU/Qt] Don't out LOG until logger set up.
  * [Qt/Draw] DO not start thread at Ui_MainWindow::LaunchEmuThread().
  * [Qt/OSD] Inherit OSD_BASE to QObject.Maybe not needed threading.
  * [Qt/EMU] MOVE a lot of methods to EMU_TEMPLATE:: and EmuThreadClassBase::.
  * [UI/Qt] MOUSE: Add mouse sensitivities config GUI.
  * [UI/Qt] Integrate to single MainWindow object.
            Fix https://matsuri.5ch.net/test/read.cgi/i4004/1601147054/80 .
  * [UI/Qt] Add confirm on quitting emulator.
  * [Qt/LOGGER] Add mutex locking to some functions called from logger.
                Fix crash on quitting a emulator.
  * [UI/Qt] Change orders of "Emulator Menu".
  * [Qt/MOUSE] Fix mouse clicking on one-board-computers.
  * [COMMON] Make method of pairXX_t with __FASTCALL.
  * [UI/Qt] FLOPPY: Use 5inch icon when using 5inch floppy.
  * [OSD/Qt] Fix using pointer after freeing.
  * [DOC] Add INSTALL.md and INSTALL.en.md.
  * [NET/Qt] Re-implement around TCP/IP, UDP/IP.MZ-2500 works.
  * [Qt/OpenGL] SHADER: Stop to use discard.
  * [Qt/OpenGL] Make shaders abstraction.
  * [Qt/OpenGL 4.5] Reduce create/destroy buffers at same screen size.
  * [Qt/OpenGL4_5] Fix around TV-Rendering.
  * [QT/OpenGL4.5] Prepare to implement screen distortion.
  * [Qt/OpenGL] Integrate shaders beyond GL version and GL/GLES.
  * [UI/Qt] Fix not update around virtual media display.
  * [UI/Qt] Fix not found disk file include kanji (or another non-latin character)
             as filename.This issue maybe happen at non-UTF-8 locale.
  * [Qt/COMMAND_LINE] Fix failure starting args "--fdx" "--bubx" with  D88/D77/B77 file.
                      Maybe fixed https://matsuri.5ch.net/test/read.cgi/i4004/1601147054/30 .
  * [BUILD/CMAKE] Support multiarch LIBDIR.
	          Maybe fixed https://matsuri.5ch.net/test/read.cgi/i4004/1601147054/21-24.
  * [BUILD/CMAKE] Try to resolve https://matsuri.5ch.net/test/read.cgi/i4004/1601147054/33.
  * [BUILD/Win32] Make CSPcommon_vm DLL.
  * [BUILD/CMAKE] FORCE SET C++ STANDARD to C++11.
  * [TOOLCHAIN/WIN32] Update cross-build X264 script.
  * [TOOLCHAIN/WIN32] Update cross building scripts for some external libraries.
  * Built with 46662e26995354caf47739a7723cd5b96dc67a26 (or later).

-- Dec 16, 2020 00:40:21 +0900 K.Ohta <whatisthis.sowhat@gmail.com>

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

8/16/2020

[VM/SCSI_DEV] improve to specify data req signal delay (thanks Mr.Sato)
[VM/SCSI_DEV] fix read6/write6 command in 0 length case (thanks Mr.Sato)
[VM/SISI_HDD] change drive type to hot swappable
[VM/SISI_HDD] improve seek time (thanks Mr.Sato)
[VM/SASI_HDD] support winchester drive parameters command
[VM/Z80DMA] improve to sense rdy signal as level, not edge (thanks Mr.Sato)

[MZ2500/CRTC] fix sub plane address in 640x200 16colors mode (thanks Mr.856)
[SVI3X8] support SPECTRAVIDEO SVI-3x8 (thanks Mr.tanam)
[X1] add menu items for FD2/FD3 (thanks Mr.Sato)
[X1/DISPLAY] fix high speed pcg definition (thanks Mr.YAT)
[X1TURBOZ/DISPLAY] improve palette update timing (thanks Mr.Sato)


8/14/2020

[OSD/WIN32] support x64 build (thank Mr.Marukun)
[OSD/WIN32] support Direct2D

[MICOM_MAHJONG] support Nippon Mail Service MICOM MAHJONG (thanks Mr.GORRY)
[TVBOY] support GAKKEN TV BOY (thanks Mr.tanam)

-----


Have fun!
-- Ohta.

