2016 New Year Anniversary & eFM-7 porting 1st anniversary,
"Various things others and eFM-7"
      Jan 1,2016 K.Ohta <whatisthis.sowhat _at_ gmail.com>

* Sorry, this document is written in Japanese only, I can not use english well.
  If you interest of this and you can translate from Japanese to any languages,  please translate this.
  This document is released with GFDL, you can copy and redistribute this document under GFDL.
  This document is written with UTF-8,and in the form along the GFDL (GNU Free Document License), you can copy and redistribute.
  
  Since English is poor write only Japanese, sorry (´・ω・｀)
  If you have some people that can be translated from Japanese into other languages,pls. tell me m(_ _)m

* Important Notice: This article has translated by GOOGLE TRANSLATION from Japanese, still not correct this article. *

1. About this (literally)
As the previous stage to make a eFM-7, Common Source Code Project (below CSP) from the beginning the porting to Qt + OpenGL, first anniversary in December 30 last year in the previous year (2014). So, maybe the historical value once after perhaps 30 years, I think (^_^;.
So, I thought to record the various miscellaneous things about emulators of Fujitsu FM-7.

2. Prehistory: XM7/​​SDL
From the front, there was a very good FM-7 emulator [1] say XM7. However, this works only on Windows. At the time of what was in 2008? or 2009, I wish to work this on the GP2X [2], South Korea's portable game machine, especially want to work the Xanadu. I ported XM7 to *nix [3] there were licensed. (Thanks to Mr.PI. author of EM7, base of XM7,
and Mr.Takegami, the author of XM7 et al). Mr.PI. agreed cheerfully, however Mr.Takegami suspected to able to port this, he was suspicious, but I ported to SDL and Gtk ,the code and screen shots but was temporarily porting, I show this to them, I was able to relatively easily license, began a full-scale work.

[1] http://retropc.net/ryu/xm7/ current development end
[2] https://ja.wikipedia.org/wiki/GP2X
[3] Eventually we gave up the porting to GP2X system in the machine specs problem, but ...

In the first period, I ported XM7 referring to the Mr.Gimons has been ported to Gtk at about 2005, porting  began from the place to port XM7 the latest version of the Gtk and SDL at that time.
Then,only reason not working in GP2X that it Gtk, I lokked for GUI toolkit only with SDL, found AGAR[4] to port.
[4] http://www.libagar.org/

At the time, I had sickness more and more seriously, typing keyboard with bedridden verge in a situation not a few even day to hit from the futon (bed), even if I wad always died considering now and was the state was not at all funny, sew the interval that does not move the body in a disease.
But it became of work, the head of 2010, out that there is a reasonably practical came.
<B> However, with the exception of the Agar's problems that a buggy </ B>.
So, I debugged one by one their bugs, then thinking seriously load balancing on the way to off-load of from multi-threaded [5] to OpenCL done before and after 2011,it is developed on the went to become sluggish.

[5] This is also utilized to eFM-7 and CSP / Qt. OpenCL is, although I think that the future is not probably do so performance does not come out.
   
Upstream (Tagegami's version XM7) had by almost completed,and I might have noticed the importance of radio in the Great East Japan Earthquake (2011-03-11), I mainly focused to work of Open I2C Radio [6] [7] project.

[6] https://osdn.jp/projects/openi2cradio/
[7] http://sky.geocities.jp/artanejp/

All told, until close to the end even 2014, the two projects advanced, Open I2C Radio is almost stable in the mid of 2013 (I think it was).As the next project, USB dongle for DigitalTV(DVB or One-Segment ISDB) using RTL2832U.
Did the project (listed in [7]) to be diverted to it to receive a shortwave and medium wave ,I had interest.

3.About XM7
In the first place, pull the EM7 that was able to prototype a time when C++ is not performance is put out too much in order to have in the footsteps, and the GUI part and FM sound source emulator of C++,that the C language of the body, but there is a very incongruous, yet also certainly to performance also out accuracy thing that was better than my eFM7. And ,I was using the UI and SDL of C++ center of adding the renderer, become a chaotic.I desired to re-create from this by scratch at mid-2014 (penitence). 
St the same time, Germany emulator collector (Is calling right?), Anna Wu had interact with Mr. Takegami from around mid-2014 , but ultimately Takegami Mr. and around the exchange of in English is reluctant, there was the fact that dispute.

I was looking at the process in Twitter, I'm sick to deats of them,that I don't use English well,very poor,but I usually report bugs in Debian GNU / Linux [8] etc and join discussion on the development in English communities where necessary, so I felt something wrong strongly to the process.
I feel uncomfortable. I think, "I don't be a place to here are of their own".
And I complain to an old friend about this, well also to foreign manufacturers in the person work it does not is probably well-known to because it was a person (I can't put out the name to go, technical force domestic I think the top class of programmers), listening to grumble ... "Your feeling is right, your stance is me too(^ ^) ", I mean that was pushed in the back.Whether it was December 28, 2014.
After all, in the direction of porting the FM-7 system to CSP, off the rudder, git on December 30, 2014
To build a repository [9], it means you put the source code at the time of the latest CSP there it is.

[8] Coincidentally, on December 28, 2015, Mr. Ian Murdok was suicided by the police assaulting. It was 42.
[9] https://github.com/Artanejp/common_source_project-fm7

4.Start Porting of CSP
In porting, the first for the tool kit was using Agar.
<B>Would work the time being. Because it is easier to verify the work say that is </ B>.
So, it was the first to work the X1 Turbo and PC-8801MA. [10]
But, since Agar was having to buggy portability and having various problems, another highly versatile.
It means require to decide using the another tool kit as GUI. [11]

[10] Since the software for operation verification there were a lot (^_^;
[11] The other, move in GP2X gave up (^_^;

Then, What shall to use ? Although I thought and, Gtk was needed another midlle wares since Gtk3, was
not good impression there is also abundance of Gnome 3's bugs,<B>So, I will use Qt I had never used at all. </B> .
I surveyed Qt4, the sound relationship and the joystick did not have a standard in (with Qt4 and 5.4) ,
SDL to do sound and Joystick, around drawing required OpenGL. Mercy is not.
By say, make a rough policy,  went to the porting.The work itself is, there is no unity even dirty
extremely're using in fumbling the Qt code although there were in, in it is possible to put the majority
of the VM in March of 2015 it has led.

Looking at the git log,
  - On January 8, X1 almost was roughly passed to compilation, with Agar
     (After a little commit fc894319809e05692fd447a5f232a46ebdf17c7)
  - On January 10, I gave up to be spoiled of Agar, decided to convert to Qt
     (Commit 98ac2645ec6a3798072445ac003f08d529d6065c)
  - On January 11, it came to the compiler passes with Qt
     (Commit 1033cc86e36b8e1d38771ef404e7d43ad07ebb39)
  - On 12 January, the basis of the drawing system and the GUI has worked and working VM?
     (However, there had a bug a lot)
     (Commit e5887aa7464c7276eef9d2578ea880988f3da60d)
  - On January 13, a keyboard part had worked and bugs around the drawing system were resolved.
     (Commit 6deec5abac027eca1a71fa89e485650d3c9735da)

Feeling called, started on December 30, trying to somehow Agar is there from 10 days it was,
to switch to Qt became various unpleasant, the basis for the Qt application in a day.
Design is increased, in one week from there, went finished the portion become now of foundation
is a translation. From there, so go as fast to work some of the VMs, until January 28.
Proceed [12], the full-fledged implementation of the FM-7 to to move an existing VM from there
was a translation that began to. [13]

[12] commit ce574213769b2685ead0df84c81f193e519d3906 later
[13] Although the December 31, 2014 I had tried to implement of FM-7,
     (Commit e409be1add5f6b9ddf76bada7c24469cb35ae2bc later),
     but counldn't be kept going to develop a lot, I decided to prioritize
	 to apply upstream of CSP to Agar and Qt.

5.eFM-7
  Well, reached to this stage, this is time to porting FM-7. Next, I got the 1980's magazined at my mother's home; Oh!FM.I begin to make FM-7's emulator based oin I/O map (written in Oh!FM and the WEB) of FM-7 and code of upstream CSP, and  I did in consideration of updtream XM7's source code.
  I re-construct codes of FM-7 emulator, because I don't wish to violate any copyrights. From February to March of 2015, I implemented of the FM-7 (to CSP).
Then, at  March 11, 2015 (coincidentally's day from the Great East Japan Earthquake of the four-year anniversary!),
still not work, but linking had succeeded [14], after this, I fixed mistake of implementation of 6809 MPU part [15] and, fixed "F5F6F7"(時分秒) disk format behavior inherence of MB8877 specification to disk.cpp / mb8877.cpp [16] , then at the end of March is, a lot of software for the FM-7 had warked. [17]

[14] commit 65fe797cd5a681ba25c14a88566d7c80d0a8cd9a
[15] This issue has roots in mc6809.cpp code was based on older version of MAME  around that time.Of course, it was not implemented miscellaneous undefined instructions,behaviors of the condition-flags of CPU had also problems.
Modify work around here is not trailing until November of 2015, I went to Kanagawa prefectural library at Kawasaki, to get a lot of (had been destroyed in my parents) material, including the portion other than the MC6809 went piled modifications to the modification.
Now of mc6809.cpp I'm thinking that there is no hindrance to say that the final version. But dirty coding(^_^;
[16] MB8877 is, the F5, F6, F7 in the data column of the time format in command for the FDC since it has been assigned, and sector number F5~F7 is not to write.
     In the 1980s, softwares that uses this in a personal computer to copy protection were a lot, because disf format using F5~F7 character code at the sector numbers or outside of sectors were a "hours, minutes and seconds special format"(時分秒フォーマット).
     This checks the F5, F6 and F7 code when it was written in the sector id and the gap of track or or, it had aimed at the copy protection = protection by putting an important program time was, but many of the copy tool (such as CopyBoy7) is only in the disk drive of the user.
     Since it was able to reproduce the 時分秒 format, copy protection used special data called "unstable data bits shift"(不安定ビットずれデータ).This was put in sector,and checks pattern of bit shift to check be master diskette.Both 時分秒 and unstable bit shift were used same copy protection mostly.
[17] commit 3c875fb911e484c15bfdad2f67dadb9bdedd5e75

Next, I aimed a target was FM77AV.
This have gained a unique device that said MMU and logical operations, linear interpolation LSI (ALU).The basic command sequence of the ALU, was referring to the XM7.
Internal biggest reason Takegami and Mr Anna was dispute is, MESS is a device of this neighborhood to be a description from XM7 it was round rip-off, but protested through Anna by Mr.Takegami, MESS community was absolutely no answer. Caused by this issue, I was careful to write around there wspecially than other parts. [18]
Currently, it works well behaved specifications, maybe not able to fine-ALU hack ...(i.e. drawing the character of the PSY-O-BLADE).
Since it has come out is somewhat of a problem with the timing calculation, we are asked to fix opportunity.

[18] In the internal structure of the ALU, what is written using the division operation of the C language in a straight line interpolation function, it is actually from this reasons.

Including around here, I often throw binaries to "Old days of the PC"(or called retro-PC) board of the ni-channels(2nちゃんねる) the PC emulator board to listen to the bug report and improvement plan to thread inhabitant was about that day.
Also became way, I think it was from around here. At the time, CSP for Qt did not work in Windows. There is the but (would be worked later).
This work was been difficulties in Somehow, as most of the softwares were run without inconsistency.It was about June 16. It is at stake after all three months. [19]

[19] commit 1b4320ef6229e75013478fe1ec66ed1eb3c47bd5

The following is, I made the FM-77. This was pushed forward without so much painful. However,I gave up to implement the 400 line part of the FM-77L4 .
--- maybe done (but maybe contains bugs a lot) 20161006 ---

However, where the boot sequence and memory map is different in subtle as well as FM-7 both 77AV is.
Become overlooked likely, There was also that the notice from the post. In particular boot RAM around.

Well, you come up here, to DMAC implement other FM77AV40EX, inevitably.
But is the translation ... or when the software increases have been spouting a variety of bugs that move, we have to various groped.
So no, it took several months here Somehow.
Much of this time of the outcome, it has been fed back to the work of Takeda's CSP authorship.
Takeda-san, thank you very much m(_ _)m

... And, on the 14th of September, AV40EX also is almost all right [20], apply to Windows from there.
And, it is a translation that will let go transplanted all of the VM.
FM-8 has got a Yaruyaru fraud, but thought I going to do sloppy.

[20] commit bbf5ed7132304d6e4c19da3cb2d634923eb55a5b per

Then, build a Windows-friendly cross-development environment of using MinGW in one month less than from there.
Or, to absorb the difference in the library of API, as much as possible included in the binary package for Win32.
So as to, while debated of via two channels of Takeda's, leading to the now.
It is a translation.

5. In the last moment
CSP also, Qt application version is also, we are still evolving. Some are proposed from my side, Takeda
Mr. also some things and those yelling put the proposal of the two channels of the thread residents to propose.
Such, of being able to something like FOSS of the best part is, I think that really be nice.
And, with respect to the FM-7 system, so it can not be denied especially sweet validation of AV system, doing a lot
Ku that there will be a pattering. But, well, because we will be doing from now on self-paced,
Including everyone of Takeda-san and user, everyone thank you m(_ _)m

                               2016 1.1 K.Ohta <whatisthis.sowhat _at_ gmail.com>

※ Postscript:

6. Bonus 1:
  How many with respect to the "1/60 of a second problem."
  The emulator, you may say, '1/60 second problem ".
  Thee actual display, and speed of the display of the vertical retrace that emulation is different
for reasons that says are often the case that the timing to synchronization is not taken, the actual display at a minimum of.
What to do with the 1 of frame = 1/60th of a second of the deviation occurs. The story to say that, to eliminate this deviation,often debate will occur not.
Something emulator you sell a deviation of less than 1/60 seconds, there you'll ne.
My position is something that "can not be helped even out up to 2 frames".
And say what it, one frame of delay a thing coming out of the difference between the out of the box, and the other 1 frame of delay, the DirectX and OpenGL that is caught between, was drawn to the "front of the frame period eliminate flickering by displaying things"structure have been commonly available on the OS side of the host machine,so the side is because that touch directly from the application may be difficult.
In other words, (if vertical retrace frequency is significantly different from a little more), the worst in two frames of about displacement more than vertical retrace frequency of Display is different Let's think of the can not be avoided. By say.
It is not intended normal applications do to stick up there, relaxation in the setting of the OS side
I It is a story that is also, if possible.
Ultimately, it would should I ask CSP side synchronized VBLANK interrupt the OS side is prepared,
Is Naa somehow think up such a thing. And, I think personally. So sides, the CSP
Please try it in people to customize based on (probably fairly or GL or Direct X or Vulkan
Since the code will change ...). GPLv2 is there also for that. I think such as(^_^;


Revision history:
* On the basis of you pointed out in the 2016-01-05 2 channel emulator comprehensive attrition,
some review the description of the facts to get a license. After, add 6. Section.
 
* To point out about the representation of the hour, minute and second protect / format when in 2016-01-07 ↑ of the plate,
           Have appended correction (fear s)

