Please enable JavaScript to display the menu.
YSFLIGHT.COM 2023

ysflight.com

Please enable JavaScript to display links.

YS FLIGHT SIMULATOR Version 20181124

Not all programs in YSFLIGHT.COM are open source.  But, you can download some of the source code from the following URL.

https://github.com/captainys/public

In Progress:

  


VICTORY TO UKRAINE!

[LINK to 2024 POSTS]

2023/12/12

I've got a new mystery about FM TOWNS computer.

One of the goals of FM TOWNS Emulator Tsugaru was to emulate FM TOWNS II MX, the last FM TOWNS I used as my primary machine, the last computer I pledged my loyalty to. One of the features of FM TOWNS II MX that had not been implemented in Tsugaru was the High-Resolution PCM. Well, it is called High-Resolution, but it is normal in the today's standard. The original PCM that was in FM TOWNS was 8-bit and up to officially 19.2KHz (looks like about 20KHz). The new PCM was up to 16-bit, 48KHz. Also the new PCM used DMA therefore less CPU intensive.

To emulate this new PCM, I needed to implement DMA. Since the I/O looked the same, I re-used the code I wrote for the main DMA.

However, with the same code, the new PCM took only half of the wave. I looked closely and turned out the BIOS was assuming 2 bytes were transferred per DMA count. I changed the implementation accordingly, and it sounded correctly.

But, this behavior was different from the main DMA. I cannot believe Fujitsu put a different-type DMA controller only for the new PCM. I/O were almost identical to the main DMA. It is reasonable to assume the DMA for the new PCM was same-type as the main DMA.

Actually the main DMA also can select 8-bit or 16-bit bus width. If 16-bit bus width is selected, 2 bytes should be transferred for each DMA cycle. The question was how the DMA count changed for each cycle. FM TOWNS's system ROM and IO.SYS writes number-of-bytes minus one to the DMA count register before firing up the DMA. DMA reaches the terminal count when the count is decremented to make it underflow to 0xFFFF. Therefore, it stops after number-of-bytes times transfer. However, if 2 bytes are transferred per count, the DMA could transfer about double the number of bytes specified in the count register, or the count register will be decremented only half of the number of bytes actually transferred.

When I was writing main-DMA code, I looked at the BIOS behavior, and I saw DMA count was set to number-of-bytes minus one. So, I wrote accordingly, and Tsugaru has been working ok with this implementation.

But, if the DMA is transferring 2 bytes per count in the 16-bit mode, for example if I start with 0x7FF(2023) count, and read a CD-ROM sector, which is 0x800(2048) bytes, the count register should be 0x3FF after one sector is done. DMA does not have to reach the terminal count as long as the CD-ROM I/O tells the CPU that the transfer is done.

To test this hypothesis, I modified my assembly code for test-reading a sector from the internal CD-ROM drive so that it prints the DMA count after reading a sector. The result from my real FM TOWNS II MX came back 0xFFFF. The count register did underflow. Therefore 2024 bytes transfer decremented the counter 2024 times. 1 byte per 1 count.

Then was DMS set to 8-bit bus mode? According to FM TOWNS Technical Databook page 69, the bus width is defined by writing to bit 1 of I/O 00A0H. If this bit is 1, 16-bit bus width. If 0, 8-bit. I checked the I/O behavior on Tsugaru, and 3 was written to this I/O. Bit 1 was 1. If the book is correct, the main DMA must be in 16-bit bus width mode.

But, the observation in the real FM TOWNS II MX seems to indicate that the DMA was in 8-bit bus mode. Was the description about this bit wrong? I looked at DMA 71071 data sheet. According to the data sheet, FM TOWNS I/O 00A0H corresponds to the initialization command, and write 1 to bit 1 is supposed to set the DMA 16-bit bus mode. Unless both the data sheet and the book were wrong, FM TOWNS's main DMA should be in the 16-bit bus mode.

Well, then it should be 1 count per 2 bytes. The count register should decrease half of the number of bytes transferred, contradicting with the observation from the real FM TOWNS.

Or, if the DMA has a mode that decrement count by 2 per cycle, it could explain. But, so far I don't find anything like that on the data sheet.

The last possibility is that the I/O 00A0H bit 1 is not really connected to the DMA. Regardless of what is written to bit 1, the main DMA may be running in the 8-bit bus mode.

Actually, FM TOWNS, from the 1st generation, comes with 2 DMA controllers. Three of the four channels of the secondary DMA controller were not used. Why the new PCM did not use one of the available channels of the secondary DMA controller? That's another mystery. But, if the new PCM chip only could accept 16-bit DMA, but the main and secondary DMA are both fixed in 8-bit bus mode, then it could explain, too.

To really solve this mystery takes a serious hardware reverse engineering. The main DMA behavior remains a mystery at this time.

2023/12/07

I have developed a bad habit of not announcing what's new here. I just upload to github, announce on FM TOWNS BBS, and Discord. I need to resume updating here.

Many says they feel time runs faster as they get older. To me, that hasn't happened yet. I've done many things this year.

I started running on a treadmill 30 minutes at at time, 3 times a week. The goal was to run 5k non stop, which I did in April during CMU Spring Carnival. So, I set my goal to run 5k in 30 minutes, which I did in September in Flyby 5k. I raised my bar to 5k in 25 minutes, but I couldn't break it in November YMCA Turkey Trot 5k. It was 26 minutes 58.9 seconds. I was able to keep up with 8.5 min/mile pacer up to 2 mile marker, then I fell behind. Now I increased speed on treadmill to prepare for the next year. Honestly I could not run 5k 20 years ago. I feel I am better fit now than then.

When I was a kid, I was obese, did relatively well in school subjects, and was not good at sports. I was a typical bullying target. What's worse was people were not recognizing that bullying was a social problem. Nobody helped me. If it were not for FM-7, I probably would have killed myself. I wonder if my bullies can run 5k now. I'm interested in watching them suffer from age-related health issues. But, that's not of high priority for me. I have too many fun things to do now.

I couldn't finish my goal of getting a flight instructor certificate this year. Well, I didn't do it in the right order. I should have started just getting used to flying from the instructor seat, which is the right seat in airplanes. Flying a relatively unfamiliar airplane, Piper Archer, from the right seat, and getting ready for the CFI check ride all at once was not realistic. Actually I don't like the design concept of Piper airplanes. Cessnas have doors on left and right. Piper single engines have a door only on the right-hand side. What if I need to crash-land and I cannot get out to the right? Or, in Cessna, if I crash land, and one door gets stuck, I still have another door to get out. Maybe I can escape through a big window. No matter how much I fly, I will never be 100% safe. There is no such thing called 100% safety. I can only get close to 100%. I like a Cessna better.

So, after my first try didn't work out, I am now trying to be able to fly a Cessna 172, my most familiar airplane, from the right seat. I flew twice with a CFI so far. The first one didn't go well. At least I didn't destroy the airplane though. The second one was much better. But, I still am not good at this weird eye movement. I need to look left to see the instruments, and then move my eyes far to the right to look straight. I tend to not making enough eye movement, resulting pushing too much right rudder. My next flight focus will be correcting it.

Recently I succeeded in sending keyboard signals to one of my retro PCs, FM77AV, in a very cheap way. I uploaded to github. But, I was too lazy to post an update here. https://github.com/captainys/FM/blob/master/7/FM77AVKeyboard/cheapFM77AVkeyboard.md I have updated Arduino program for sending infra-red keyboard signal to FM77AV. The same code works for wired and wireless now. Just upload this to Arduino, and correctly connect GND, KDETECT, and KSDATA pins to correct pins on Arduino. Then connect to Arduino to any serial terminal such as TeraTerm. Whatever you type on the serial terminal will appear on FM77AV. All FM77AV series computers use same keyboard signals, so as long as you make a correct connection, the same method should work for FM77AV, AV20, AV40, AV20EX, AV40EX, and AV40SX. Probably it is the cheapest way so far to send keyboard signals to FM77AV series. If you use my control program, it gets good enough response to play games as well.

And, recently someone fabricated a 64KB FRAM card with Rescue IPL for FM TOWNS, and put it onYahoo! Auction . It busted surprising 40K JPY! The person who put it on Auction called my Rescue IPL as "God Software". I'm humbled :-) Actually that motivated me and tried to make an FRAM card that fits in a PCMCIA case. The last time I tried, I forced a 0.7mm-thick PCB into a connector for 0.4mm-thick PCB, which made a bulge, which prevented the card from going into FM TOWNS tower model's memory-card slot. Also the structural stress from the metal cracked the solder joint. But, this time, I really made a 0.4mm-thick PCB. This time it looks great. Now it is impossible to get a new PCMCIA case, but I have some in stock. Maybe I make some and also put on auction.

I need to organize pictures from San Francisco Fleet Week airshow, and upload here, but... next time.

2023/08/17

It was a summer with full of events.

I started training to become a flight instructor. I passed a written exam, and finished my spin training. I also flew several times from the right (instructor) seat. But, the airplane, Piper Archer, was a difficult one. Not that Piper Archer was difficult, this particular Archer was difficult. First, the rudder was so mis-adjusted, that I didn't even have to push right-rudder on take off. I complained to the mechanic, then I had to push hard right rudder all the time. That was the last flight I took in that airplane. I almost decided to abort take off, I think I should have, but somehow I was able to control, so I took off Butler County and flew back to Allegheny. I was so used to perfectly-maintained Cessna 172 N37MT. This particular one was difficult to fly. Then the Archer was grounded due to paperwork. The flight school I started training suspended the operation. No progress since then.

But, two good things from the partial training. One of them was I finally got an answer to a question that I haven't been able to find since 14 years old. Let's say you keep angle-of-attack zero. You turn the york to the left or right to start rolling the airplane. Then you move the yoke back to center. From the experience, I know the airplane stops rolling. But, physically, it means that the rolling moment acted on the airplane to the opposite direction of the rolling. Where is this rolling moment come from? If the left and right wings have same angle-of-attack same airspeed, nothing would make a moment to stop rolling. But, in reality, the rolling stops. I finally got answer during the ground instruction for my spin training. Because the wing going down has larger angle of attack than the other side, there will be a meaningful imbalance of lift between right and left wings. This imbalance creates rolling moment that counteracts and stops the rolling. Finally made sense.

Another thing was the instructor encouraged me to fly in a high-wind condition. I did so with him. I was actually able to handle 20kt wind. So I raised my personal minimum. My personal minimum used to be wind 15kt, cross-wind component 12kt. But, now wind 20kt, cross-wind component 15kt. We call it 'minimum', but we mean worst. So, it is the highest wind that I would take off into. In fact I already applied my new minimum when I took a friend who are leaving Pittsburgh and going back to Japan. The reported wind was 20kt, but I took off, and came back with no difficulty. Then, during the flying-club spot-landing competition, wind was 19kt, but I was able to handle comfortably.

Then I finished Daikoukaijidai 2 for FM TOWNS on my FM TOWNS Emulator Tsugaru. I enjoyed Daikoukaijidai 1 a lot. So, I really wanted to play the sequal. What I thought after finishing all scenarios was, what happened to Lutia? There were three girls that played an important roles in the story, Lutia, Paula, and Radia. Paula and Radia were depicted in the game ending. But, Lutia was not in the ending. She was just forgotten as if they she didn't exist. Why???? I searched for her all over the world after the abduction event.

Then Columbus Air Show. I for the first time saw F-5. I think. I may have seen it in 1995 and 1997 in Miramar Air Show, but it could have been T-38. I cannot tell now. I am thinking to upload some pictures from Columbus Air Show here, but I've been procrastinating.

Then my wife's family visited Pittsburgh. I took them for a sight-seeing flight to Niagara Falls.

Then my car was hit from behind. Pittsburgh Police Bomb Squad truck hit Audi behind my Honda Fit, then the Audi hit my Fit. My 2009 Honda Fit was spared from being totalled, but it is still in the shop.

Then business trip to Japan.

My cousins and their family visited Pittsburgh. I took them for sight-seeing flights over downtown Pittsburgh. That week I took my friend who are leaving Pittsburgh for sight-seeing flight, and I participated the flying-club's spot-landing competition. I made four round trips to Beaver and made six sorties. Six flights were ok. But, driving round trips to Beaver was somewhat tiring. Flying airplane is find, but driving a car is tiring.

So, it was a very eventful summer for me. But, I am not feeling that I achieved something, maybe because the summer was over before getting a flight instructor certificate.

By the way, nobody is already talking about it, but regarding the TITAN submersible accident. I saw in some Japanese news sites saying the passengers and a crew was first burnt by 6000C, or 10800F, air before compressed to death, because the air temperature jumps up when adiabatically compressed to 300 atoms, or 4400 psi. I tell you most likely it didn't happen. Probably the cause of death was organ damage from the compression, suffocation due to compression to the lung, or the blunt damage from the water rushing into the cabin. I thought this 6000C thing was from Japan, but I realized there was a video that depicted the ship imploding with flames. The narratives were in English, so someone English speaker didn't have a sense of science.

I haven't calculated, so I don't know how high temperature that the air was heated due to the compression. It is true that the air temperature goes up when compressed without releasing heat to outside. My guess is, 6000C was calculated based on the air compressed from 1 atom to 300 atom with no heat exchange, we call it adiabatic compression. Let's say it was an adiabatic compression. The compression happened within a fraction of second, maybe the time was too short to transfer much heat from the air to sea water rushing into the cabin. But, to get to 6000C, the volume of air needs to become real small. And, the water won't keep the air in one piece. Most likely the air was divided into small bubbles, maybe order of millimeters diameter. Then quickly cooled down. Even if the bubble touched the human body before cooling down, it probably could make only a spot or two of burns. There is no way for such a small 6000C air engulf a human body and burn to death.

And, it was not really adiabatic. The heat freely could escape to the sea water. As the air bubble compressed and temperature goes up, at some point it exceeds the boiling temperature. At that time, it should have acted as a significant brake for the temperature going up. No matter how fast it occured, the water could evaporate. If it was 300 atoms, the boiling temperature could have been like several hundred C? The water interfacing with the air temporarily had lower pressure, so it could have been lower. Anyway, I doubt it really could reach 6000C. Those tiny air bubbles will be heat up to much less than 6000C temperature in a fraction of second, and then cooled down in the next fraction of second.

Lastly, as I said, it should have been tiny high-temperature bubbles. Unless the bubble was touching something combustible before cooled down, it didn't burn. Just dissipated the heat to the surrounding water. In fact, even if it did, most likely it couldn't sustain the fire more than a fraction of fraction of second. So, most likely there was no visible fire. Yeah, that was a nice visual. Not reality.

Of course, it doesn't change the fate of the crew and the passengers. But, this 6000C thing was bothering me from the beginning because most likely inaccurate.

2023/08/15

I've been lazy in updating my web site this year, and it's already August :-P

I wish I were already a Certified Flight Instructor by now. However, I had too many events this summer to get trained. Plus, the flight school I was training from suspended the operation, and I don't know when I can resume the training. I didn't pay for block discount and was paying hourly, so there is no financial damage. Rather, I am confident in flying in high-wind condition. I raised my personal minimum from max 15kt any direction 12kt cross wind to max 20kt any direction cross wind 15kt.

Business Trip to Japan

This travel was out of luck even before leaving Pittsburgh. A few days before the departure, my 2009 Honda Fit was hit from behind. I was completely stopping in a traffic jam. Someone tried to shift the lane behind me. The Pittsburgh Police Bomb Squad truck hit that guy, pushed his car into my car. My poor Fit. It was the second time this car was hit from behind while stopping. It was a slow-speed collision. However, a corner of the car behind me hit my car. The body got somewhat large dent. The shock was strong enough to blow off my sunglasses, but maybe due to regular weight training, I sustained no injury.

Actually, my boss said I could extend the travel or leave early by a few days for visiting friends or family. But, I didn't leave early since I wanted to go to Dayton air show, which we cancelled anyway due to some other issues. We couldn't go anyway due to the car crash. I didn't extend the stay either because I have been working on my Certified Flight Instructor certificate, and I didn't want to leave training too long. However, the airplane I was using for CFI training was grounded due to some paperwork issues. The training is still suspended as of August 10, and I don't know when I can resume. There was no point to rush back to Pittsburgh.

I didn't have a good luck recently.

Overall, if you look at my life so far, I think I am very lucky. I was born far away from Tokyo. I was vaguely thinking I would go to local university and maybe become a teacher there. In reality, I ended up getting Ph.D from Carnegie Mellon and now am teaching programming, my favorite subject. Once I dreamed of writing a computer program that is used all over the world. And, I wrote YS Flight Simulator and FM TOWNS Emulator Tsugaru, which are both used all over the world. Once I dreamed of becoming a pilot. And, I am frequently flying a Cessna 172. I probably am the luckiest person in the world. Nonetheless, if you only look at the last a few weeks, I was feeling pretty unfortunate.

(Read More)






2023/02/07

Mitsubishi Heavy Industry officially terminated regional-jet development program. If I were allowed to lead the team, I would have started with letting everyone in the team get private-pilot certificate. It is only my guess, but I suppose they might have wasted substantial time and resource at the very beginning fixing something obvious from pilots' point of view.

2023/01/07

Happy New Year!

Two trips to Japan in 2022 started with unreasonable detention, ended with being impressed by the power of AirTag

Finally COVID was over in 2022. So, we made two trips to Japan to see friends and family. But, in the first trip, I was unreasonably detained for 10 days. That was a detention. Not quarantine. I was treated like a rabbit. The second trip went smoothly all the way to the end, but the airline failed to load one of my two checked luggages. However, since I put AirTag in the bag, I was able to track the movement the next day all the way from Tokyo Haneda airport to Pittsburgh International. That was very impressive. Read More.


Mt. Fuji from Shinkansen train

Sunrise 2023/01/01 (taken before boarding my plane back to the U.S.)

Can I finish all 200 stages of Flappy for FM-7 if I use state-save and load?

This new-year's day break, I spent five days to see if I could finish all 200 stages of Flappy for FM-7 (1984) if I used state-save. This game was popular but difficult like HELL. I've used my FM77AV Emulator Mutsu. It took 5 days to finish 200 stages, but I succeeded.


[LINK to 2022 POSTS]

 
Comments are welcome.  Send E-Mail to: 

Back to http://www.ysflight.com