Write a simple music program (1)

Source: Internet
Author: User

 

I hope to have a music program that can run on freerunner's mobile phone to record the reconciliation between my son and his classmates. I started to think that I could just find a music program and compile it in the freerunner mobile phone environment. However, after compiling and running cgoban and quarry, I found that these programs are not suitable for mobile phone environments. I think my requirements are very simple. I wrote a simple program dapu with GTK.

Dapu is developed on the Windows platform and vc6 environment using GTK. When writing programs, you always have to consider your needs. Now I am very casual to write programs for myself. I mainly implement the recording and replay functions. There is a general format called sgf in the Board chart. But I am too troublesome. I didn't do sgf. I defined a simple format, which is the running effect of the Windows environment.

If the source program has not been modified, compile it on Ubuntu to run it:

Then, after being built in the poky openembedded environment, run it on freerunner. The building was successful, and it was found that the pieces were incorrectly painted. Add a line of print to find the reason. My definition:

# Define stone_empty0 // No child # define STONE_BLACK-1/blacklist # define stone_white1 // white child # define STONE_BLACK_LAST-2 // The last Sunday # define stone_white_last2 // the last white child typedef char color;

I define the chess sub-type as char and use-1 to represent sunspots. This is no problem on VC and GCC on PC. In VC and GCC on PC, char is signed Char by default. But on GCC on arm, char is unsigned char by default. Therefore, in my judgment:

If (stone = stone_black ){...}

Freerunner is comparing whether 255 and-1 are equal, so he painted the pawn wrong. You only need to change the definition of the chess piece type:

Typedef signed Char color;

You can run freerunner correctly on your phone.

It took several nights to develop on Windows. It took half an hour to port to Ubuntu and freerunner.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.