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

                                                       February 22, 2019
                            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_20190222
   
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).

* 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 February 22, 2019
  * Upstream 2019-02-19.
  * [VM] Fix crash when end of emulation at various(!) VMs.
  * [DEBUGGER/EMU] Some functions at debugger.cpp moved (and modified) to emu.cpp. This workaround needed by libCSPcommon .
  * [EMUUTIL/WIN32] Temporally disable SSE2.
  * [VM/I8080] I8085: Fix around SID instruction.FP200 works.
  * [VM/MSM5205] Add new API: pause_w().
  * [VM/MSM5205] Adjust ADPCM's sound level due to be too small sound.
  * [VM/UPD71071] Add 16bits transfer mode (needs to emulate FM-Towns).
  * [VM/PCENGINE] Separate around ADPCM from pce.cpp.
  * [VM/PCENGINE] Mostly works CD-ROM^2 softwares, excepts (at least) Valis2 and R-TYPE. Some softwares still contain wrong working.
  * [VM/SCSI_CDROM] CDDA: Fix interpreting cue sheet.Lasersoft's brand softwares may works.
  * [VM/SCSI_CDROM] CDDA:Don't update track when setting end position.
  * [OSD/Sound] Update OSD API, initialize_sound() has 4 args, not 2.
  * [OSD/Sound] SDL_MixAudioFormat() *MUST* use for SDL2, shouldn't use SDL_MixAudio for SDL2.
  * [Qt/OpenGL] Asynchronous pixel transfer with OpenGL 4.5 (and Core profile renderer).
  * [Qt/OpenGL] Now, core profile needs less than OpenGL 4.5.
  * [Qt/OpenGL] Fix not save screenshot with OpenGL renderers.(This issue didn't happen with OpenGL ES).
  * [Qt/AVIO] Fix wrong color at one-board-computers.
  * Built with 7574bd8b47c65e32c4f4a41ec593db71cc375230 (or later).
  
-- February 22, 2019 04:44:44 +0900 K.Ohta <whatisthis.sowhat@gmail.com>

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

2/19/2019

[VM/DEVICE] add is_primary_cpu() and update_extra_event()
[VM/EVENT] support to udpate event while cpu is running one opecode
[VM/Z80] improve to update event in every read/write cycle

[MZ2500/MEMORY] improve pcgram wait in display timing


2/16/2019

[EMU/DEBUGGER] improve to enumerate devices that is debugger available
[EMU/DEBUGGER] improve to show all breaked reasons
[EMU/DEBUGGER] support breakpoint of cpu selected by "! device" command
[EMU/*] simplify code for debugger
[VM/*] simplify code for debugger

[VM/I8237] support break point for direct memory access
[VM/MB8877] fix not to wait 60ms to start read/write after seek is finished
[VM/MC6844] support break point for direct memory access
[VM/TMS9918A] support break point for registers and vram access
[VM/UPD71071] support break point for direct memory access
[VM/Z80DMA] support break point for direct i/o and memory access


2/14/2019

[EMU/DEBUGGER] support break point for non-cpu device
[EMU/DEBUGGER] change command length from 64 to 1024

[VM/AY_3_891X] support break point
[VM/DEVICE] add get_debug_data_addr_space()
[VM/DEVICE] change type of get_debug_regs_info() from void to bool
[VM/MB8877] fix to decrease first seek time by 500us (2D/2DD) or 250us (2HD)
[VM/TMS9918A] support break point
[VM/YM2151] support break point
[VM/YM2203] support break point
[VM/Z80CTC] fix to reset interrupt req/in service by bit2 of control register
[VM/Z80DMA] fix to reset interrupt req/in service by reset command

[X1TURBO/EMM] support to access vram as memory space from debugger
[X1TURBO/IOBUS] support to access vram as memory space from debugger
[X1TURBO/IOBUS] support break point


2/9/2019

[EMU/DEBUGGER] enlarge text buffer size

[VM/DEVICE] add get_context_child() to enumerate daisy-chained devices
[VM/DISK] add get_sector_info()
[VM/MB8877] improve debugger to show current head position and disk geometry
[VM/MB8877] fix not to abort command when eject disk in unselected drive
[VM/UPD765A] improve debugger to show current head position and disk geometry
[VM/Z80*] add get_context_child() to enumerate daisy-chained devices

[X1TURBO] fix to force clear iei/oei of z80 family devices when reset vm
[X1TURBO/DISPLAY] fix to check bit0/2 of port 0x1fd0 in draw_text()


2/8/2019

[EMU/*] simplify code to draw screen while debugging cpu
[OSD/*] simplify code to draw screen while debugging cpu
[VM/*] simplify code to draw screen while debugging cpu

[BUBCOM80/DISPLAY] improve dmac
[HC80/IO] fix slave-cpu command 0x27 and 0x29 (thanks Mr.Stefano Bodrato)


2/7/2019

[EMU/DEBUGGER] improve to draw screen while debugging cpu
[EMU] add override/restore/run_wndproc() for debugger
[EMU] add create_bank_floppy_disk()
[OSD/WIN32] add override/restore/run_wndproc() for debugger

[VM/315_5124] improve draw_screen() for debugger
[VM/H6280] improve to run window procedure while suspending for debugger
[VM/I286] improve to run window procedure while suspending for debugger
[VM/I386] improve to run window procedure while suspending for debugger
[VM/I8080] improve to run window procedure while suspending for debugger
[VM/M6502] improve to run window procedure while suspending for debugger
[VM/MC6800] improve to run window procedure while suspending for debugger
[VM/MC6809] improve to run window procedure while suspending for debugger
[VM/MCS48] improve to run window procedure while suspending for debugger
[VM/TMS9918A] improve draw_screen() for debugger
[VM/TMS9995] improve to run window procedure while suspending for debugger
[VM/UPD7801] improve to run window procedure while suspending for debugger
[VM/UPD7810] improve to run window procedure while suspending for debugger
[VM/V9938] improve draw_screen() for debugger
[VM/V99X8] improve draw_screen() for debugger
[VM/Z80] improve to run window procedure while suspending for debugger

[BUBCOM80/DISPLAY] improve draw_screen() for debugger
[FAMILYBASIC/PPU] improve draw_screen() for debugger
[MZ80K/DISPLAY] improve draw_screen() for debugger
[MZ1500/MEMORY] improve draw_screen() for debugger
[PC8801/PC88] improve draw_screen() for debugger
[PCENGINE/PCE] improve draw_screen() for debugger
[SMC777/MEMORY] improve draw_screen() for debugger
[X1/DISPLAY] improve draw_screen() for debugger


1/29/2019

[MZ80K/MEMORY] support COLOR GAL 5 (thanks Mr.Suga)
[PC8001/PC88] fix issue that cursor is mistakenly hidden


1/18/2019

[PC8001/PC88] clear ram[0xff33] for DEMPA Galaxian
[SMC777/MEMORY] improve to render screen in each scan line


1/16/2019

[EMU] improve to reinitialize vm in reset when dipswitch is changed

[VM/UPD765A] fix st3 in sence devstat command to set two-side bit (temporary)

[PC8801] support GSX-8800
[PC8801] support to enable/disable PC-8801-11/GSX-8800/PCG-8100
[PC8801] fix some degradations

-----


Have fun!
-- Ohta.

