2008年7月15日 星期二

Build WINCE 6 R2 from start

裝好 WINCE 6 & Updates 還有RMI BSP之後
開始build

會遇到下面問題
1. Warning C4819

UILD: [01:0000000030:ERRORE] C:\WINCE600\PLATFORM\DB1200\src\drivers\WAVEMDD\.\common.c : error C2220: warning treated as error - no 'object' file generated
BUILD: [01:0000000031:WARNN ] C:\WINCE600\PLATFORM\DB1200\src\drivers\WAVEMDD\.\common.c : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss

把Common.c Save 成Unicode (File->Advance Save Option) 可以解決這個問題
起因應該是某個common.c 的character (new line?) 在codepage 950 (Big5)之下 為亂碼
所以compile failed (實在不太了解這個檔為什麼會有問題 剛好某個字元被當成big5 code? (好像在註解中))
而且codepage 是950?

2. fmerge nlssrc.txt problem

在build bsp 時 常會出現以下錯誤

makeimg: run command: fmerge -txt E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\postproc\nlssrc.txt C:\WINCE600\public\common\oak\files\locale.txt E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\nlssrc.txt


fmerge for Windows CE (Release) (Built on Apr 5 2006 11:32:16)
makeimg: FATAL ERROR: Command returned non-zero exit code 1 (dec).
makeimg: FATAL ERROR: Command returned non-zero exit code 1 (dec).


因為 fmerge 第三個參數 E:\wince6Wasp1\RelDir\DB1200_MIPSII_Debug\nlssrc.txt 不存在

可是為什麼會不存在呢? 那個是release dir

經過爬文 http://groups.google.co.yu/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/42e5396933c17be0/641e77f039427012

應該在buildrel phase 出了問題

把project property --> build options --> Use Xcopy instead of links.. 打勾就行了

再下copy files to release directory 命令



3. AC97.c 缺少以下定義



#define ZONE_AC97_ERROR 1
#define ZONE_ERROR 1
#define ZONE_AC97_FUNC 1
#define ZONE_AC97_DMA 1
#define ZONE_FUNCTION 1

可設 0 或 1 或條件式


4. display\16bpp.h 32bpp.h

#define DEBUG 0

DEBUG redefinition

BUILD: [01:0000000177:WARNN ] c:\wince600\platform\db1200\src\drivers\display\16Bpp.h(3) : warning C4005: 'DEBUG' : macro redefinition



在尋找solution的時候 找了以下一些資訊

Info

Make Binary Image Tool

http://msdn.microsoft.com/en-us/library/aa908853.aspx

http://jusweny.spaces.live.com/Blog/cns!88C641BFCCD350D4!2202.entry



2008年7月4日 星期五

MAC MPEG2 problem

http://rodfathermobile.com/2008/04/09/encoding-to-h264-with-vlc-using-sendto/

WINCE Keyboard

最近又為了客戶的需求,又要加入French的Keyboard
雖然之前有做過German的Keyboard,不過又全部忘記了... ~~
當初是怎麼做出那個DLL的 @@

重新複習了一下

首先 先用kbdgen (在 \wince500\public\common\oak\bin\i386下面)
然後把 Windows下的 kbdfr.dll ( \Windows\system32) copy 到kbdgen 的目錄下

下kbdgen的 command
法國區碼為 040C
結果如下


c:\wince500\public\common\oak\bin\i386\kbdgen kbdfr.dll -o cekbdfr -i 0000040C
kbdgen for Windows CE (Release) (Built on Dec 30 2003 15:22:20)
Warning - Generating desktop VK to CE VK conversions for the Input Language:
Warning -   Desktop VK_OEM_6         assigned to CE VK_RBRACKET
Warning -   Desktop VK_OEM_5         assigned to CE VK_BACKSLASH
Warning -   Desktop VK_OEM_4         assigned to CE VK_LBRACKET
Warning -   Desktop VK_OEM_PLUS      assigned to CE VK_EQUAL
Warning -   Desktop VK_OEM_1         assigned to CE VK_SEMICOLON
Warning -   Desktop VK_OEM_7         assigned to CE VK_APOSTROPHE
Warning -   Desktop VK_OEM_3         assigned to CE VK_BACKQUOTE
Warning -   Desktop VK_OEM_COMMA     assigned to CE VK_COMMA
Warning -   Desktop VK_OEM_PERIOD    assigned to CE VK_PERIOD
Warning -   Desktop VK_OEM_2         assigned to CE VK_SLASH
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF
Warning - Generating VKeyToXTScanCodeTable:
Warning -   The following duplicate entries have been ignored
Warning -   Virtual key VK_CLEAR             (0x0C) - Scan code 0x59
Warning -   Virtual key VK_TAB               (0x09) - Scan code 0x7C
Warning -   Virtual key VK_RETURN            (0x0D) - Scan code 0xE01C
Warning - Generating desktop VK to CE VK conversions for the Device Layout:
Warning -   Desktop VK_OEM_4         assigned to CE VK_LBRACKET
Warning -   Desktop VK_OEM_PLUS      assigned to CE VK_EQUAL
Warning -   Desktop VK_OEM_6         assigned to CE VK_RBRACKET
Warning -   Desktop VK_OEM_1         assigned to CE VK_SEMICOLON
Warning -   Desktop VK_OEM_3         assigned to CE VK_BACKQUOTE
Warning -   Desktop VK_OEM_7         assigned to CE VK_APOSTROPHE
Warning -   Desktop VK_OEM_5         assigned to CE VK_BACKSLASH
Warning -   Desktop VK_OEM_COMMA     assigned to CE VK_COMMA
Warning -   Desktop VK_OEM_PERIOD    assigned to CE VK_PERIOD
Warning -   Desktop VK_OEM_2         assigned to CE VK_SLASH
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF
Warning -   Desktop VK_OEM_WSCTRL    no CE match
Warning -   Desktop VK_OEM_FINISH    assigned to CE VK_DBE_KATAKANA
Warning -   Desktop VK_OEM_JUMP      no CE match
Warning -   Desktop VK_OEM_BACKTAB   assigned to CE VK_DBE_ROMAN
Warning -   Desktop VK_OEM_AUTO      assigned to CE VK_DBE_SBCSCHAR
Warning -   Desktop VK_OEM_PA3       no CE match
Warning -   Desktop VK_OEM_RESET     no CE match
Warning -   Desktop VK_ABNT_C1       no CE match
Warning -   Desktop VK_OEM_PA1       no CE match
Warning -   Desktop VK_ABNT_C2       no CE match
Warning -   Desktop VK_OEM_8         assigned to CE VK_OFF

會產生3個檔案

cekbdfr.reg
cekbdfrIL.cpp
cekbdfrDL.cpp
主要要export 2個函式出去 IL_0000040C
PS2_AT_0000040c




在platform builder help 中
How to Migrate a Keyboard Driver to Conform to the Layout Manager Interface
這個topic就是我們所要的

基本上 這個DLL要輸出以下一些函式
.def 的內容如下


LIBRARY LAYOUTMANAGER

EXPORTS

KeybdDriverInitializeEx
KeybdDriverPowerHandler
KeybdDriverGetInfo
KeybdDriverSetMode
KeybdDriverInitStates
KeybdDriverVKeyToUnicode
KeybdDriverMapVirtualKey

LayoutMgrGetKeyboardType
LayoutMgrGetKeyboardLayout
LayoutMgrGetKeyboardLayoutName
LayoutMgrGetKeyboardLayoutList
LayoutMgrLoadKeyboardLayout
LayoutMgrActivateKeyboardLayout

IL_0000040C
PS2_AT_0000040C

重點要Link的Library如下
LayoutManager.lib Required
Kbdmscommon.lib, or the library representing your keyboard PDD Required
Kbdpddlist.lib, or the library representing your PDD list Required
KeybdIst.lib Required if you are using the generic IST from %_WINCEROOT%\Public\Common\Oak\Drivers\Keybd\Ist
InputLang_0409.lib, or the library representing the input languages Required unless the input language is in a separate DLL
PS2_AT_00000409.lib, or the library representing the device layouts Required unless the device layout is in a separate DLL
NumPadRmp.lib Required if any of the device layout remapping functions use this library


在nop (非8042) 下為

SOURCELIBS=\
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Nop_KbdCommon.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\Nop_PddList.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\LayoutManager.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\kbdfr_lib.lib \ <---ps2_at_0000040c br=""> $(_COMM
ONOAKROOT)\lib\$(_CPUINDPATH)\NumPadRmp.lib \
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\InputLang_040C.lib \

在dll目錄下照抄 KbdnopUS的 sources 這個檔案
把名字US的部份改成FR
把DOSYSGEN=1這行刪掉
才能build dll 否則會build出 kbdnopfr_lib.lib


2014新增
之前法文鍵盤沒有處理到 accents 的部份
http://french.about.com/od/pronunciation/a/accents.htm

French accents 有四種
accent aigu ´ (acute accent) can only be on an E
accent grave ` (grave accent) can be found on an AE, or U
accent circonflexe ˆ (circumflex) can be on anAEIO, or U
accent tréma ¨ (dieresis or umlaut) can be on an EI, or U.

在WINCE 處理的部份, 稱為 DeadKey

In laymgr.cpp

PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY   KeybdDriverMapVirtualKey

call
PFN_KEYBD_DRIVER_VKEY_TO_UNICODE KeybdDriverVKeyToUnicode

call
static VKeyToUnicode

call
static GetCharacters

call
static ProcessLigature

call
static ProcessDeadKeys


Euro problem
在Unicode 中, euro sign 為 0x20AC
或者是 0x80 (depend on code page, 如 cp1252 )
要打出歐元 "應該"(未測試) 要在registry 內加上
[HKEY_LOCAL_MACHINE\nls]
    "ExtraCurrency"=dword: 20ac

但是這個需要NLS support

所以用0x80 或許是另一個替代方法
但0x80 在某些非歐系國家中 不一定是euro sign
但Unicode 0x80 是euro sign
http://msdn.microsoft.com/en-us/library/aa448398.aspx