享受視覺,

享受音樂,

泡杯咖啡,

再來細細品嘗每一篇文章不是很棒的一件事嗎 ?

請移到新部落格喔~ zzz

2010年2月19日 星期五

[閒聊] AGen 2d game engine

AGen
Engine plugins: DirectSound 8.1, DirectInput 8.1, DirectInput 9, DirectX 8.1, DirectX 9, OpenAL, OpenGL and SDL Input
Lua 5.1 with extensions: MicroPather, Box2D, LuaFileSystem, LuaSocket, LuaXML and DevIL

找到一個很棒且輕量級的遊戲引擎,支援物理引擎、FileIO、Socket 網路程式設計等

範例
display:create ( "Mouse input", 640, 480, 32, true )

my_font = Font ( )
my_font:load_system ( "Arial", 18 )

my_sprite = Sprite ( )
display.viewport:add_child ( my_sprite )

mouse.on_move = function ( delta_x, delta_y )
my_sprite.canvas:clear ( )
my_sprite.canvas:move_to ( mouse.xaxis, mouse.yaxis )
my_sprite.canvas:set_font ( my_font )
my_sprite.canvas:write ( mouse.xaxis .. " " .. mouse.yaxis )
end

顯示滑鼠作標 :D~

想學 Lua script 請別錯過,
尤其 Lua (from the Portuguese word for moon) is the scripting language used by World of Warcraft for Interface Customization.

另外附上 lua IDE

2010年2月13日 星期六

[教學] AS3 不同的的 if 判斷式寫法

if (true) {
 x++;
 a = Math.random()*100000;
 b = Math.random()*100000;
} else {
 trace("good1");
 trace("good2");
}

if(true)
 x++ ,
 a = Math.random()*100000 ,
 b = Math.random()*100000
else
 trace("good1") ,
 trace("good2")

記得若用下面的方法,則
b = Math.random()*100000 與
trace("good2") 後面不加逗號

[Hey蘋果] nVidia 系列顯卡如何推算NVCAP編碼值?


我想很多人都知道蘋果公司在去年9月推出 snow leopard 雪豹,有很多人想在一般筆電上安裝 MacOSX,但是裝好後最大的問題在於沒有網卡、顯卡與聲音裝置之驅動程式。於是有些人開始製作一些 kexts、dsdt、efi string 好讓 Mac 以外的網卡、顯卡與聲音裝置能夠順利跑起來。相反的也有很多人在 MacOSX 裝 windows 系統,驅動程式就好解決,畢竟 Mac 沒有像 windows 有這麼多種類的硬體,這邊就不提了。

參考 http://bbs.pcbeta.com/thread-592288-1-1.html - 一步一步在 windows 上安裝雪豹

網卡、聲卡的安裝上都還好解決,唯有顯卡驅動最麻煩。回到正題,我的平台與顯示卡是 Sony Vaio VGN-C25T / nVidia Geforce Go 7400 64mb

1. windows vista 下用 everest/nvflash/NiBiTor 擇一生出顯卡 bios(xxx.rom)
2. snow loepard 下使用 nvcap maker 讀取 rom 生出 nvcap 值如下:
(nvcap code : 04000000 00000200 04000000 00000007 00000000)
3. snow leopard 下用 Property List Editor.app 將 nvcap 編碼
(nvcap encode code : BAAAAAAAAgAEAAAAAAAABwAAAAA=)
4. windows vista 下將 nvcap 填入他人製作 ( ex:NVinjectGo/Natit ...etc ) kexts 的 info .plist 當中
5. 進入 snow leopard 看有沒有驅動成功或進入黑屏


參考 nvcap 取得文章 http://hi.baidu.com/gioguo/blog/item/2c727a3ebfcf9cfe838b13cd.html
參考不同 nvcap 值用途 ttp://hi.baidu.com/gioguo/blog/item/3d50973db5f9f7ea3c6d977a.html

為了要求編碼值 3~5 的步驟要來回切換作業系統很費時,我直接找到了編碼推算方法~方便其他 nVidia 顯卡使用者可以測試不同的 NVCAP.

我的nvcap (中括弧為更動的地方)
04000000 0000[02]00 [04]000000 000000[07] 00000000 : BAAAAAAA[Ag]A[E]AAAAAAAA[Bw]AAAAA=
編碼規則
04000000 0000[xx]00 [xx]000000 000000[xx] 00000000 : BAAAAAAA[xx]A[x]AAAAAAAA[xx]AAAAA=

第1個 xx 為 channel 1
第2個 xx 為 channel 2
第3個 xx 為 channel 3

channel1變動影響編碼如下:
04000000 0000[00]00 04000000 00000007 00000000 : BAAAAAAA[AA]AEAAAAAAAABwAAAAA=
04000000 0000[01]00 04000000 00000007 00000000 : BAAAAAAA[AQ]AEAAAAAAAABwAAAAA=
04000000 0000[02]00 04000000 00000007 00000000 : BAAAAAAA[Ag]AEAAAAAAAABwAAAAA=
04000000 0000[03]00 04000000 00000007 00000000 : BAAAAAAA[Aw]AEAAAAAAAABwAAAAA=
04000000 0000[04]00 04000000 00000007 00000000 : BAAAAAAA[BA]AEAAAAAAAABwAAAAA=
04000000 0000[05]00 04000000 00000007 00000000 : BAAAAAAA[BQ]AEAAAAAAAABwAAAAA=
04000000 0000[06]00 04000000 00000007 00000000 : BAAAAAAA[Bg]AEAAAAAAAABwAAAAA=
04000000 0000[07]00 04000000 00000007 00000000 : BAAAAAAA[Bw]AEAAAAAAAABwAAAAA=
04000000 0000[08]00 04000000 00000007 00000000 : BAAAAAAA[CA]AEAAAAAAAABwAAAAA=
04000000 0000[09]00 04000000 00000007 00000000 : BAAAAAAA[CQ]AEAAAAAAAABwAAAAA=
04000000 0000[0a]00 04000000 00000007 00000000 : BAAAAAAA[Cg]AEAAAAAAAABwAAAAA=
04000000 0000[0b]00 04000000 00000007 00000000 : BAAAAAAA[Cw]AEAAAAAAAABwAAAAA=
04000000 0000[0c]00 04000000 00000007 00000000 : BAAAAAAA[DA]AEAAAAAAAABwAAAAA=
04000000 0000[0d]00 04000000 00000007 00000000 : BAAAAAAA[DQ]AEAAAAAAAABwAAAAA=

04000000 0000[0e]00 04000000 00000007 00000000 : BAAAAAAA[Dg]AEAAAAAAAABwAAAAA=
04000000 0000[0f]00 04000000 00000007 00000000 : BAAAAAAA[Dw]AEAAAAAAAABwAAAAA=
04000000 0000[10]00 04000000 00000007 00000000 : BAAAAAAA[EA]AEAAAAAAAABwAAAAA=
04000000 0000[11]00 04000000 00000007 00000000 : BAAAAAAA[EQ]AEAAAAAAAABwAAAAA=
04000000 0000[12]00 04000000 00000007 00000000 : BAAAAAAA[Eg]AEAAAAAAAABwAAAAA=
04000000 0000[13]00 04000000 00000007 00000000 : BAAAAAAA[Ew]AEAAAAAAAABwAAAAA=
............


channel2變動影響編碼如下:
04000000 00000200 [00]000000 00000007 00000000 : BAAAAAAAAgA[A]AAAAAAAABwAAAAA=
04000000 00000200 [01]000000 00000007 00000000 : BAAAAAAAAgA[B]AAAAAAAABwAAAAA=
04000000 00000200 [02]000000 00000007 00000000 : BAAAAAAAAgA[C]AAAAAAAABwAAAAA=
04000000 00000200 [03]000000 00000007 00000000 : BAAAAAAAAgA[D]AAAAAAAABwAAAAA=
04000000 00000200 [04]000000 00000007 00000000 : BAAAAAAAAgA[E]AAAAAAAABwAAAAA=
04000000 00000200 [05]000000 00000007 00000000 : BAAAAAAAAgA[F]AAAAAAAABwAAAAA=
04000000 00000200 [06]000000 00000007 00000000 : BAAAAAAAAgA[G]AAAAAAAABwAAAAA=
04000000 00000200 [07]000000 00000007 00000000 : BAAAAAAAAgA[H]AAAAAAAABwAAAAA=
04000000 00000200 [08]000000 00000007 00000000 : BAAAAAAAAgA[I]AAAAAAAABwAAAAA=
04000000 00000200 [09]000000 00000007 00000000 : BAAAAAAAAgA[J]AAAAAAAABwAAAAA=
04000000 00000200 [0a]000000 00000007 00000000 : BAAAAAAAAgA[K]AAAAAAAABwAAAAA=
04000000 00000200 [0b]000000 00000007 00000000 : BAAAAAAAAgA[L]AAAAAAAABwAAAAA=
04000000 00000200 [0c]000000 00000007 00000000 : BAAAAAAAAgA[M]AAAAAAAABwAAAAA=
04000000 00000200 [0d]000000 00000007 00000000 : BAAAAAAAAgA[N]AAAAAAAABwAAAAA=
04000000 00000200 [0e]000000 00000007 00000000 : BAAAAAAAAgA[O]AAAAAAAABwAAAAA=
04000000 00000200 [0f]000000 00000007 00000000 : BAAAAAAAAgA[P]AAAAAAAABwAAAAA=
04000000 00000200 [10]000000 00000007 00000000 : BAAAAAAAAgA[Q]AAAAAAAABwAAAAA=
04000000 00000200 [11]000000 00000007 00000000 : BAAAAAAAAgA[R]AAAAAAAABwAAAAA=
04000000 00000200 [12]000000 00000007 00000000 : BAAAAAAAAgA[S]AAAAAAAABwAAAAA=
04000000 00000200 [13]000000 00000007 00000000 : BAAAAAAAAgA[T]AAAAAAAABwAAAAA=
04000000 00000200 [14]000000 00000007 00000000 : BAAAAAAAAgA[U]AAAAAAAABwAAAAA=
04000000 00000200 [15]000000 00000007 00000000 : BAAAAAAAAgA[V]AAAAAAAABwAAAAA=
04000000 00000200 [16]000000 00000007 00000000 : BAAAAAAAAgA[W]AAAAAAAABwAAAAA=
04000000 00000200 [17]000000 00000007 00000000 : BAAAAAAAAgA[X]AAAAAAAABwAAAAA=
04000000 00000200 [18]000000 00000007 00000000 : BAAAAAAAAgA[Y]AAAAAAAABwAAAAA=
04000000 00000200 [19]000000 00000007 00000000 : BAAAAAAAAgA[Z]AAAAAAAABwAAAAA=
04000000 00000200 [1a]000000 00000007 00000000 : BAAAAAAAAgA[a]AAAAAAAABwAAAAA=
04000000 00000200 [1b]000000 00000007 00000000 : BAAAAAAAAgA[b]AAAAAAAABwAAAAA=
04000000 00000200 [1c]000000 00000007 00000000 : BAAAAAAAAgA[c]AAAAAAAABwAAAAA=
04000000 00000200 [1d]000000 00000007 00000000 : BAAAAAAAAgA[d]AAAAAAAABwAAAAA=
04000000 00000200 [1e]000000 00000007 00000000 : BAAAAAAAAgA[e]AAAAAAAABwAAAAA=
..........

channel3變動影響編碼如下:
04000000 00000200 04000000 000000[00] 00000000 : BAAAAAAAAgAEAAAAAAAA[AA]AAAAA=
04000000 00000200 04000000 000000[01] 00000000 : BAAAAAAAAgAEAAAAAAAA[AQ]AAAAA=
04000000 00000200 04000000 000000[02] 00000000 : BAAAAAAAAgAEAAAAAAAA[Ag]AAAAA=
04000000 00000200 04000000 000000[03] 00000000 : BAAAAAAAAgAEAAAAAAAA[Aw]AAAAA=
04000000 00000200 04000000 000000[04] 00000000 : BAAAAAAAAgAEAAAAAAAA[BA]AAAAA=
04000000 00000200 04000000 000000[05] 00000000 : BAAAAAAAAgAEAAAAAAAA[BQ]AAAAA=
04000000 00000200 04000000 000000[06] 00000000 : BAAAAAAAAgAEAAAAAAAA[Bg]AAAAA=
04000000 00000200 04000000 000000[07] 00000000 : BAAAAAAAAgAEAAAAAAAA[Bw]AAAAA=
04000000 00000200 04000000 000000[08] 00000000 : BAAAAAAAAgAEAAAAAAAA[CA]AAAAA=
04000000 00000200 04000000 000000[09] 00000000 : BAAAAAAAAgAEAAAAAAAA[CQ]AAAAA=
04000000 00000200 04000000 000000[0a] 00000000 : BAAAAAAAAgAEAAAAAAAA[Cg]AAAAA=
04000000 00000200 04000000 000000[0b] 00000000 : BAAAAAAAAgAEAAAAAAAA[Cw]AAAAA=
04000000 00000200 04000000 000000[0c] 00000000 : BAAAAAAAAgAEAAAAAAAA[DA]AAAAA=
04000000 00000200 04000000 000000[0d] 00000000 : BAAAAAAAAgAEAAAAAAAA[DQ]AAAAA=
04000000 00000200 04000000 000000[0e] 00000000 : BAAAAAAAAgAEAAAAAAAA[Dg]AAAAA=
04000000 00000200 04000000 000000[0f] 00000000 : BAAAAAAAAgAEAAAAAAAA[Dw]AAAAA=
04000000 00000200 04000000 000000[10] 00000000 : BAAAAAAAAgAEAAAAAAAA[EA]AAAAA=
04000000 00000200 04000000 000000[11] 00000000 : BAAAAAAAAgAEAAAAAAAA[EQ]AAAAA=
04000000 00000200 04000000 000000[12] 00000000 : BAAAAAAAAgAEAAAAAAAA[Eg]AAAAA=
04000000 00000200 04000000 000000[13] 00000000 : BAAAAAAAAgAEAAAAAAAA[Ew]AAAAA=
........

以上就是 nvcap 編碼推算,往後的值可以自己推算 :D