什麼!司徒你又開了一個新帖~不是要研究草食系統嗎?難道,草食系統已經進入生命結束前必須完成的作品之中嗎?這...不好說~司徒把這個帖子看待成番外篇,番外的特性就是盡量不要引起外人注意就草草結束~此時,邪惡的鍵盤俠可能要說:司徒的話如果可以信,狗屎都可以吃了,坦白說,司徒的話確實可以信的,狗屎也確實是可以吃的~
番外篇的目標如下:
1. 可以從MicroSD進入Linux系統
2. 可以支援雙系統
3. 可以控制屏幕顯示
4. 可以玩GBA模擬器
P.S. 達標後,此貼就會結帖
簡要規格
CPU Allwinner F1C200S ARM9 408MHz
RAM 32MB
Flash 128MB
Screen 1.15" 240x180
Gamepad DPad, 2 Buttons, Start
Port MicroUSB
Battery AAAx2
Dimension 80mm x 40mm x 20mm
Weight 60g
正面
下邊
側邊
上邊
側邊
精美的包裝盒,真像以前購買GB卡帶的感覺...
背面
主機
相較於PocketGo的大小
正面
背面
PCB主板
Allwinner F1C200S
8006UL LD53EG(聲音放大)
PCB正面
XT26G01AWSEGA
X1308V0 20200727
屏24Pin
ALT-013BSLN-J2
喇叭
有落塵可能
B面
AAAx2
軟膠墊
DPad中心支撐在軟膠墊上
离线
沙发!前排支持
离线
有串口吗?
离线
哈哈哈,司徒你多大了?文章开头好中二啊哈哈哈
离线
司徒应该不是20, 因为年龄越小对掌机越没得感觉, 喜欢掌机都是像我这样的老骨头了.
离线
@tigger
老骨头總是有相同的默契~哈~
UART位置
跳線
連接UART
Baudrate 115200bps
[0]HELLO! BOOT0 is starting!
[2]boot0 commit : e9d7c88390ded1551ff4a4bcfef31cbc9cf717cb
[0]HELLO! BOOT0 is starting!
[2]boot0 commit : e9d7c88390ded1551ff4a4bcfef31cbc9cf717cb
[0]HELLO! BOOT0 is starting!
[2]boot0 commit : e9d7c88390ded1551ff4a4bcfef31cbc9cf717cb
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.10.65 (oe-user@oe-host) (gcc version 8.3.0 (GCC) ) #1 Tue Jul 21 03:52:29 UTC 2020
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: Allwinner A1X (Device Tree), model: sun3iw1p1
[ 0.000000] bootconsole [earlycon0] enabled
INIT: version 2.88 booting
/dev/nandh: LABEL="UDISK" UUID="2b800baa-27fe-453f-a194-cee18ef6824a" TYPE="ext4"
/dev/nandh already format by ext4
/dev/nande: LABEL="rootfs_data" UUID="3e6930be-09d1-481c-b098-4e68743a36f6" TYPE="ext4"
/dev/nande already format by ext4
Starting udev
hwclock: can't open '/dev/misc/rtc': No such file or directory
Tue Jul 21 04:02:17 UTC 2020
hwclock: can't open '/dev/misc/rtc': No such file or directory
rm: can't remove '/tmp': Read-only file system
rm: can't remove '/etc/resolv.conf': Read-only file system
ln: /etc/resolv.conf: File exists
INIT: Entering runlevel: 5
Configuring network interfaces... ip: SIOCGIFFLAGS: No such device
hwclock: can't open '/dev/misc/rtc': No such file or directory
Starting syslogd/klogd: done
Vivid-Yocto-Distro V0.1 c200s-gamegearmicro /dev/ttyS0
c200s-gamegearmicro login:
离线
司徒想了想,發現有一個位置可以用來擺放MicroSD
F1C200S左邊是屏的走線,右邊則是用來跳線連接MicroSD,這改機難度屬於中上...
為了方便跳線,司徒先將10uPF、1M電阻拆掉
原本想直接使用MicroSD元件,但是,發現接觸的排針會脫落,需要固定,因此,司徒找來一個肉雞
電宰後...
相當完美的位置
但是,下方是屏的走線,假如先改造MicroSD,這屏的問題可能就很難解
因此,司徒打算先把屏的初始化代碼找出來,於是開始刮線
腳位圖
標示位置
跳線
屏的走線真的蠻細的,需要一點苦工,司徒一想到後面的MicroSD跳線,有種想哭的感覺...
寨機邏輯分析儀上場
由上而下分別是:CS、RD、RS、WR、PD0、DB0~DB7、PD8,從這個圖,得到四個資訊:
1. 屏的驅動方式是MCU方式(i80)
2. 屏有TE腳位(Screen Tearing)
3. PD0是TE腳位
4. PD8是RESET腳位
TE腳位剛好是60Hz,代表這個屏的顯示可以達60FPS,相當不錯的屏
邏輯分析儀取得的資料
0.000000000,1,1,1,0,0,0,0,0,0,0,0,1
0.000002600,1,1,1,0,0,0,0,0,0,0,0,0
0.000003200,1,1,1,0,0,0,0,0,0,0,0,1
0.110548360,1,1,1,0,0,0,0,0,0,0,0,0
0.220564240,1,1,1,0,0,0,0,0,0,0,0,1
0.230566400,1,1,1,0,0,0,0,0,0,0,0,0
0.240566320,1,1,1,0,0,0,0,0,0,0,0,1
0.340535600,0,0,1,0,0,0,1,0,0,0,1,1
0.340535640,0,0,0,0,0,0,1,0,0,0,1,1
0.340535680,0,0,1,0,0,0,1,0,0,0,1,1
0.340535720,1,1,1,0,0,0,0,0,0,0,0,1
0.460496120,0,0,0,0,0,1,1,0,1,1,0,1
0.460496200,1,1,1,0,0,0,0,0,0,0,0,1
0.460598320,0,1,0,0,0,0,0,1,1,0,0,1
0.460598400,1,1,1,0,0,0,0,0,0,0,0,1
0.460699800,0,0,1,0,0,0,0,1,0,0,0,1
0.460699840,0,0,0,0,0,1,1,1,1,0,0,1
0.460699880,0,0,1,0,0,1,1,1,1,0,0,1
0.460699920,1,1,1,0,0,0,0,0,0,0,0,1
0.460801720,0,1,1,0,0,0,0,0,0,1,1,1
0.460801760,0,1,0,0,0,0,0,0,0,1,1,1
0.460801800,0,1,1,0,0,0,0,0,0,1,1,1
0.460801840,1,1,1,0,0,0,0,0,0,0,0,1
0.460902760,0,0,0,0,0,1,1,0,0,1,0,1
0.460902840,1,1,1,0,0,0,0,0,0,0,0,1
0.461004640,0,0,1,0,0,1,1,0,0,1,1,1
0.461004680,0,0,0,0,0,1,1,0,0,1,1,1
0.461004720,0,0,1,0,0,1,1,0,0,1,1,1
0.461004760,1,1,1,0,0,0,0,0,0,0,0,1
0.461105680,0,1,1,0,0,0,0,0,0,0,0,1
0.461105720,0,1,0,0,0,0,0,0,0,0,0,1
0.461105760,1,1,1,0,0,0,0,0,0,0,0,1
0.461206600,0,0,1,1,0,1,1,0,1,0,0,1
0.461206640,0,0,0,1,0,1,1,0,1,0,0,1
0.461206680,0,0,1,1,0,1,1,0,1,0,0,1
0.461206720,1,1,1,0,0,0,0,0,0,0,0,1
0.461308600,0,1,1,0,0,0,0,1,0,1,0,1
0.461308640,0,1,0,0,0,0,0,1,0,1,0,1
0.461308680,0,1,1,0,0,0,0,1,0,1,0,1
0.461308720,1,1,1,0,0,0,0,0,0,0,0,1
0.461409520,0,1,1,0,0,0,0,0,0,0,0,1
0.461409560,0,1,0,0,0,0,0,1,0,1,0,1
0.461409600,0,1,1,0,0,0,0,1,0,1,0,1
0.461409640,1,1,1,0,0,0,0,0,0,0,0,1
0.461510560,0,1,1,0,0,0,0,0,0,0,0,1
0.461510600,0,1,0,0,0,0,0,0,0,0,0,1
0.461510640,0,1,1,0,0,0,0,0,0,0,0,1
0.461510680,1,1,1,0,0,0,0,0,0,0,0,1
0.461612480,0,1,0,0,0,1,1,0,1,0,1,1
0.461612560,1,1,1,0,0,0,0,0,0,0,0,1
0.461713480,0,1,1,0,0,1,0,0,1,0,1,1
0.461713520,0,1,0,0,0,1,1,0,1,0,1,1
0.461713560,0,1,1,0,0,1,1,0,1,0,1,1
0.461713600,1,1,1,0,0,0,0,0,0,0,0,1
0.461815400,0,0,1,1,0,1,1,0,1,1,1,1
0.461815440,0,0,0,1,0,1,1,0,1,1,1,1
0.461815480,1,1,1,1,0,1,0,0,0,0,0,1
0.461815520,1,1,1,0,0,0,0,0,0,0,0,1
0.461916440,0,1,0,0,0,0,0,0,1,0,0,1
0.461916520,1,1,1,0,0,0,0,0,0,0,0,1
0.462017360,0,0,1,1,0,1,1,1,1,0,1,1
0.462017400,0,0,0,1,0,1,1,1,1,0,1,1
0.462017440,1,1,1,0,0,0,0,0,0,0,0,1
0.462119360,0,1,1,0,0,1,1,0,0,0,0,1
0.462119400,0,1,0,0,0,1,1,0,0,0,0,1
0.462119440,1,1,1,0,0,1,0,0,0,0,0,1
0.462119480,1,1,1,0,0,0,0,0,0,0,0,1
0.462220280,0,0,1,1,1,0,0,0,0,0,0,1
0.462220320,0,0,0,1,1,0,0,0,0,0,0,1
0.462220360,0,0,1,1,1,0,0,0,0,0,0,1
0.462220400,1,1,1,0,0,0,0,0,0,0,0,1
0.462321200,0,1,1,0,0,1,0,1,0,1,0,1
0.462321240,0,1,0,0,0,1,0,1,0,1,0,1
0.462321280,0,1,1,0,0,1,0,1,0,1,0,1
0.462321320,1,1,1,0,0,0,0,0,0,0,0,1
0.462422240,0,0,1,1,1,0,0,0,1,0,0,1
0.462422280,0,0,0,1,1,0,0,0,1,0,0,1
0.462422320,1,1,1,1,1,0,0,0,1,0,0,1
0.462422360,1,1,1,0,0,0,0,0,0,0,0,1
0.462523160,0,1,1,0,0,0,0,0,0,0,1,1
0.462523200,0,1,0,0,0,0,0,0,0,0,1,1
0.462523240,0,1,1,0,0,0,0,0,0,0,1,1
0.462523280,1,1,1,0,0,0,0,0,0,0,0,1
0.462624200,0,0,1,1,1,0,0,0,1,0,1,1
0.462624240,0,0,0,1,1,0,0,0,1,0,1,1
0.462624280,1,1,1,0,0,0,0,0,0,0,0,1
0.462725120,0,1,1,0,0,0,1,0,1,1,1,1
0.462725160,0,1,0,0,0,0,1,0,1,1,1,1
0.462725200,0,1,1,0,0,0,1,0,1,1,1,1
0.462725240,1,1,1,0,0,0,0,0,0,0,0,1
0.462826040,0,0,1,1,1,0,0,0,0,1,0,1
0.462826080,0,0,0,1,1,0,0,0,0,1,0,1
0.462826120,0,0,1,1,1,0,0,0,0,1,0,1
0.462826160,1,1,1,0,0,0,0,0,0,0,0,1
0.462927960,0,1,1,0,0,1,0,0,0,0,0,1
0.462928000,0,1,0,0,0,1,0,0,0,0,0,1
0.462928040,1,1,1,0,0,0,0,0,0,0,0,1
0.463029000,0,0,0,1,1,0,0,0,1,1,0,1
0.463029080,1,1,1,0,0,0,0,0,0,0,0,1
0.463130000,0,1,1,0,0,0,0,1,1,1,1,1
0.463130040,0,1,0,0,0,0,0,1,1,1,1,1
0.463130080,0,1,1,0,0,0,0,1,1,1,1,1
0.463130120,1,1,1,0,0,0,0,0,0,0,0,1
0.463231920,0,0,1,1,1,0,1,0,0,0,0,1
0.463231960,0,0,0,1,1,0,1,0,0,0,0,1
0.463232000,1,1,1,0,0,0,0,0,0,0,0,1
0.463332960,0,1,0,1,0,1,0,0,0,1,0,1
0.463333000,0,1,1,1,0,1,0,0,0,1,0,1
0.463333040,1,1,1,0,0,0,0,0,0,0,0,1
0.463434840,0,1,1,1,0,1,0,0,0,0,1,1
0.463434880,0,1,0,1,0,1,0,0,0,0,1,1
0.463434920,0,1,1,1,0,1,0,0,0,0,1,1
0.463434960,1,1,1,0,0,0,0,0,0,0,0,1
0.463535760,0,0,1,1,1,0,1,0,1,1,0,1
0.463535800,0,0,0,1,1,0,1,0,1,1,0,1
0.463535840,0,0,1,1,1,0,1,0,1,1,0,1
0.463535880,1,1,1,0,0,0,0,0,0,0,0,1
0.463636800,0,1,1,1,0,1,0,0,0,0,1,1
0.463636840,0,1,0,1,0,1,0,0,0,0,1,1
0.463636880,1,1,1,0,0,1,0,0,0,0,0,1
0.463636920,1,1,1,0,0,0,0,0,0,0,0,1
0.463738720,0,0,0,1,1,1,0,0,0,0,0,1
0.463738800,1,1,1,0,0,0,0,0,0,0,0,1
0.463839720,0,1,1,1,1,0,1,0,0,0,0,1
0.463839760,0,1,0,1,1,0,1,0,0,0,0,1
0.463839800,0,1,1,1,1,0,1,0,0,0,0,1
0.463839840,1,1,1,0,0,0,0,0,0,0,0,1
0.463940760,0,1,1,0,0,0,0,0,0,1,0,1
0.463940800,0,1,0,0,0,0,0,0,0,1,0,1
0.463940840,1,1,1,0,0,0,0,0,0,0,0,1
0.464042680,0,1,0,0,0,0,0,1,0,1,0,1
0.464042720,0,1,1,0,0,0,0,1,0,1,0,1
0.464042760,1,1,1,0,0,0,0,0,0,0,0,1
0.464143680,0,1,1,0,0,0,1,0,0,0,1,1
0.464143720,0,1,0,0,0,0,1,0,0,0,1,1
0.464143760,0,1,1,0,0,0,1,0,0,0,1,1
0.464143800,1,1,1,0,0,0,0,0,0,0,0,1
0.464245600,0,1,1,0,0,0,1,0,1,0,1,1
0.464245640,0,1,0,0,0,0,1,0,1,0,1,1
0.464245680,1,1,1,0,0,0,0,0,0,0,0,1
0.464346520,0,1,1,0,0,1,0,1,0,1,0,1
0.464346560,0,1,0,0,0,1,0,1,0,1,0,1
0.464346600,1,1,1,0,0,1,0,0,0,0,0,1
0.464346640,1,1,1,0,0,0,0,0,0,0,0,1
0.464447560,0,1,0,0,0,1,1,1,1,0,1,1
0.464447640,1,1,1,0,0,0,0,0,0,0,0,1
0.464549440,0,1,1,0,1,0,1,0,0,1,1,1
0.464549480,0,1,0,0,1,0,1,0,0,1,1,1
0.464549520,0,1,1,0,1,0,1,0,0,1,1,1
0.464549560,1,1,1,0,0,0,0,0,0,0,0,1
0.464650480,0,1,1,0,1,0,0,0,0,1,0,1
0.464650520,0,1,0,0,1,0,0,0,0,1,0,1
0.464650560,1,1,1,0,0,0,0,0,0,0,0,1
0.464751400,0,1,1,0,0,0,1,0,1,1,0,1
0.464751440,0,1,0,0,0,0,1,0,1,1,0,1
0.464751480,0,1,1,0,0,0,1,0,1,1,0,1
0.464751520,1,1,1,0,0,0,0,0,0,0,0,1
0.464852320,0,1,1,0,0,0,0,1,0,1,1,1
0.464852360,0,1,0,0,0,0,0,1,0,1,1,1
0.464852400,0,1,1,0,0,0,0,1,0,1,1,1
0.464852440,1,1,1,0,0,0,0,0,0,0,0,1
0.464953360,0,1,1,0,0,0,0,1,1,0,1,1
0.464953400,0,1,0,0,0,0,0,1,1,0,1,1
0.464953440,1,1,1,0,0,0,0,1,1,0,0,1
0.464953480,1,1,1,0,0,0,0,0,0,0,0,1
0.465054280,0,1,1,0,0,0,1,1,1,1,1,1
0.465054320,0,1,0,0,0,0,1,1,1,1,1,1
0.465054360,0,1,1,0,0,0,1,1,1,1,1,1
0.465054400,1,1,1,0,0,0,0,0,0,0,0,1
0.465155200,0,1,1,0,0,1,0,0,0,0,1,1
0.465155240,0,1,0,0,0,1,0,0,1,0,1,1
0.465155280,0,1,1,0,0,1,0,0,1,0,1,1
0.465155320,1,1,1,0,0,0,0,0,0,0,0,1
0.465256240,0,0,1,1,1,1,0,0,0,0,1,1
0.465256280,0,0,0,1,1,1,0,0,0,0,1,1
0.465256320,0,0,1,1,1,1,0,0,0,0,1,1
0.465256360,1,1,1,0,0,0,0,0,0,0,0,1
0.465358160,0,1,0,1,1,0,1,0,0,0,0,1
0.465358240,1,1,1,0,0,0,0,0,0,0,0,1
0.465459160,0,1,1,0,0,0,0,0,0,1,0,1
0.465459200,0,1,0,0,0,0,0,0,0,1,0,1
0.465459240,0,1,1,0,0,0,0,0,0,1,0,1
0.465459280,1,1,1,0,0,0,0,0,0,0,0,1
0.465560120,0,1,0,0,0,0,0,1,1,0,1,1
0.465560200,1,1,1,0,0,0,0,0,0,0,0,1
0.465662120,0,1,0,0,0,0,1,0,0,0,0,1
0.465662200,1,1,1,0,0,0,0,0,0,0,0,1
0.465763040,0,1,1,0,0,0,1,0,1,0,1,1
0.465763080,0,1,0,0,0,0,1,0,1,0,1,1
0.465763120,1,1,1,0,0,0,0,0,0,0,0,1
0.465865040,0,1,1,0,0,1,0,1,0,1,0,1
0.465865080,0,1,0,0,0,1,0,1,0,1,0,1
0.465865120,1,1,1,0,0,0,0,0,0,0,0,1
0.465965960,0,1,1,0,0,1,1,1,1,0,0,1
0.465966000,0,1,0,0,0,1,1,1,1,0,0,1
0.465966040,0,1,1,0,0,1,1,1,1,0,0,1
0.465966080,1,1,1,0,0,0,0,0,0,0,0,1
0.466067000,0,1,1,0,1,0,0,0,0,1,0,1
0.466067040,0,1,0,0,1,0,0,0,0,1,0,1
0.466067080,1,1,1,0,0,0,0,0,0,0,0,1
0.466168880,0,1,1,0,1,0,1,0,0,0,1,1
0.466168920,0,1,0,0,1,0,1,0,0,0,1,1
0.466168960,0,1,1,0,1,0,1,0,0,0,1,1
0.466169000,1,1,1,0,0,0,0,0,0,0,0,1
0.466269920,0,1,1,0,0,1,0,0,1,1,0,1
0.466269960,0,1,0,0,0,1,0,0,1,1,0,1
0.466270000,1,1,1,0,0,1,0,0,1,0,0,1
0.466270040,1,1,1,0,0,0,0,0,0,0,0,1
0.466370840,0,1,1,0,0,0,1,1,1,1,1,1
0.466370880,0,1,0,0,0,0,1,1,1,1,1,1
0.466370920,0,1,1,0,0,0,1,1,1,1,1,1
0.466370960,1,1,1,0,0,0,0,0,0,0,0,1
0.466472840,0,1,1,0,0,0,1,1,1,1,1,1
0.466472880,0,1,0,0,0,0,1,1,1,1,1,1
0.466472920,0,1,1,0,0,0,1,1,1,1,1,1
0.466472960,1,1,1,0,0,0,0,0,0,0,0,1
0.466573800,0,1,0,0,0,1,0,0,0,0,0,1
0.466573840,0,1,1,0,0,1,0,0,0,0,0,1
0.466573880,1,1,1,0,0,0,0,0,0,0,0,1
0.466675800,0,1,0,0,0,1,0,0,1,0,1,1
0.466675880,1,1,1,0,0,0,0,0,0,0,0,1
0.466776720,0,0,1,0,0,1,0,0,0,0,1,1
0.466776760,0,0,0,0,0,1,0,0,0,0,1,1
0.466776800,1,1,1,0,0,0,0,0,0,0,0,1
0.466877720,0,0,1,0,0,1,0,1,0,0,0,1
0.466877760,0,0,0,0,0,1,0,1,1,0,0,1
0.466877800,0,0,1,0,0,1,0,1,1,0,0,1
0.466877840,1,1,1,0,0,0,0,0,0,0,0,1
0.466979640,0,1,1,0,0,0,0,0,0,0,0,1
0.466979680,0,1,0,0,0,0,0,0,0,0,0,1
0.466979720,0,1,1,0,0,0,0,0,0,0,0,1
0.466979760,1,1,1,0,0,0,0,0,0,0,0,1
0.467080560,0,1,1,0,0,0,0,0,0,0,0,1
0.467080600,0,1,0,0,0,0,0,0,0,0,0,1
0.467080640,0,1,1,0,0,0,0,0,0,0,0,1
0.467080680,1,1,1,0,0,0,0,0,0,0,0,1
0.467181600,0,1,1,0,0,0,0,0,0,0,0,1
0.467181640,0,1,0,0,0,0,0,0,0,0,0,1
0.467181680,1,1,1,0,0,0,0,0,0,0,0,1
0.467283520,0,1,0,1,1,1,0,1,1,1,1,1
0.467283560,0,1,1,1,1,1,0,1,1,1,1,1
0.467283600,1,1,1,0,0,0,0,0,0,0,0,1
0.467384520,0,0,1,0,0,1,0,1,1,0,1,1
0.467384560,0,0,0,0,0,1,0,1,1,0,1,1
0.467384600,0,0,1,0,0,1,0,1,1,0,1,1
0.467384640,1,1,1,0,0,0,0,0,0,0,0,1
0.467486440,0,1,1,0,0,0,0,0,0,0,0,1
0.467486480,0,1,0,0,0,0,0,0,0,0,0,1
0.467486520,1,1,1,0,0,0,0,0,0,0,0,1
0.467587440,0,1,1,0,0,0,0,0,0,0,0,1
0.467587480,0,1,0,0,0,0,0,0,0,0,0,1
0.467587520,0,1,1,0,0,0,0,0,0,0,0,1
0.467587560,1,1,1,0,0,0,0,0,0,0,0,1
0.467688480,0,1,1,0,0,0,0,0,0,0,0,1
0.467688520,0,1,0,0,0,0,0,0,0,0,0,1
0.467688560,0,1,1,0,0,0,0,0,0,0,0,1
0.467688600,1,1,1,0,0,0,0,0,0,0,0,1
0.467790400,0,1,0,1,1,1,0,1,1,1,1,1
0.467790480,1,1,1,0,0,0,0,0,0,0,0,1
0.467891400,0,0,1,0,0,0,0,0,0,0,0,1
0.467891440,0,0,0,0,0,0,0,0,0,0,0,1
0.467891480,0,0,1,0,0,0,0,0,0,0,0,1
0.467891520,1,1,1,0,0,0,0,0,0,0,0,1
0.467992360,0,0,0,0,0,1,0,1,0,0,1,1
0.467992440,1,1,1,0,0,0,0,0,0,0,0,1
0.587952560,0,0,0,0,0,1,0,1,0,1,0,1
0.587952640,1,1,1,0,0,0,0,0,0,0,0,1
0.588053280,0,0,1,0,0,1,0,1,0,1,0,1
0.588053320,0,0,0,0,0,1,0,1,0,1,0,1
0.588053360,1,1,1,0,0,1,0,0,0,0,0,1
司徒寫了一隻Python用來解資料
#!/usr/bin/python
import os
import sys
f = open('digital.csv')
c = f.readlines()
f.close()
for x in c:
l = x.replace('\r', '').replace('\n', '').split(',')
t0 = l[0]
cs = l[1]
rs = l[2]
wr = l[3]
db = '0x%02x' % int(''.join('{:x}'.format(int(v)) for v in l[4:12]), 2)
rst = l[12]
if cs == '0' and wr == '0':
if rs == '0':
print 'CMD:{}'.format(db)
else:
print 'DAT:{}'.format(db)
解譯後的屏初始化資料
CMD:0x11
CMD:0x36
DAT:0x0c
CMD:0x3c
DAT:0x03
CMD:0x32
CMD:0x33
DAT:0x00
CMD:0xb4
DAT:0x0a
DAT:0x0a
DAT:0x00
DAT:0x35
DAT:0x35
CMD:0xb7
DAT:0x04
CMD:0xbd
DAT:0x30
CMD:0xc0
DAT:0x2a
CMD:0xc4
DAT:0x01
CMD:0xc5
DAT:0x17
CMD:0xc2
DAT:0x20
CMD:0xc6
DAT:0x0f
CMD:0xd0
DAT:0xa2
DAT:0xa1
CMD:0xd6
DAT:0xa1
CMD:0xe0
DAT:0xd0
DAT:0x02
DAT:0x0a
DAT:0x11
DAT:0x15
DAT:0x2a
DAT:0x3d
DAT:0x53
DAT:0x42
DAT:0x16
DAT:0x0b
DAT:0x0d
DAT:0x1f
DAT:0x25
CMD:0xe1
DAT:0xd0
DAT:0x02
DAT:0x0d
DAT:0x10
DAT:0x15
DAT:0x2a
DAT:0x3c
DAT:0x42
DAT:0x51
DAT:0x26
DAT:0x1f
DAT:0x1f
DAT:0x20
DAT:0x25
CMD:0x21
CMD:0x2c
DAT:0x00
DAT:0x00
DAT:0x00
DAT:0xef
CMD:0x2d
DAT:0x00
DAT:0x00
DAT:0x00
DAT:0xef
CMD:0x00
CMD:0x29
CMD:0x2a
CMD:0x2a
main.s
.global _start
.equiv PIO_BASE, 0x01c20800
.equiv PA, (0x24 * 0)
.equiv PB, (0x24 * 1)
.equiv PC, (0x24 * 2)
.equiv PD, (0x24 * 3)
.equiv PE, (0x24 * 4)
.equiv PIO_CFG0, 0x00
.equiv PIO_CFG1, 0x04
.equiv PIO_CFG2, 0x08
.equiv PIO_DATA, 0x10
.equiv LCD_CS, (1 << 21)
.equiv LCD_RD, (1 << 20)
.equiv LCD_RS, (1 << 19)
.equiv LCD_WR, (1 << 18)
.equiv LCD_RST, (1 << 0)
.arm
.text
_start:
.long 0xea000016
.byte 'e', 'G', 'O', 'N', '.', 'B', 'T', '0'
.long 0, __spl_size
.byte 'S', 'P', 'L', 2
.long 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
_vector:
b reset
b .
b .
b .
b .
b .
b .
b .
reset:
ldr r4, =PIO_BASE + PD
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PE
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PD
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
ldr r4, =PIO_BASE + PE
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
bl lcd_rst
ldr r0, =0x11
bl lcd_cmd
ldr r0, =0x36
bl lcd_cmd
ldr r1, =0x0c
bl lcd_dat
ldr r0, =0x3c
bl lcd_cmd
ldr r1, =0x03
bl lcd_dat
ldr r0, =0x32
bl lcd_cmd
ldr r0, =0x33
bl lcd_cmd
ldr r1, =0x00
bl lcd_dat
ldr r0, =0xb4
bl lcd_cmd
ldr r1, =0x0a
bl lcd_dat
ldr r1, =0x0a
bl lcd_dat
ldr r1, =0x00
bl lcd_dat
ldr r1, =0x35
bl lcd_dat
ldr r1, =0x35
bl lcd_dat
ldr r0, =0xb7
bl lcd_cmd
ldr r1, =0x04
bl lcd_dat
ldr r0, =0xbd
bl lcd_cmd
ldr r1, =0x30
bl lcd_dat
ldr r0, =0xc0
bl lcd_cmd
ldr r1, =0x2a
bl lcd_dat
ldr r0, =0xc4
bl lcd_cmd
ldr r1, =0x01
bl lcd_dat
ldr r0, =0xc5
bl lcd_cmd
ldr r1, =0x17
bl lcd_dat
ldr r0, =0xc2
bl lcd_cmd
ldr r1, =0x20
bl lcd_dat
ldr r0, =0xc6
bl lcd_cmd
ldr r1, =0x0f
bl lcd_dat
ldr r0, =0xd0
bl lcd_cmd
ldr r1, =0xa2
bl lcd_dat
ldr r1, =0xa1
bl lcd_dat
ldr r0, =0xd6
bl lcd_cmd
ldr r1, =0xa1
bl lcd_dat
ldr r0, =0xe0
bl lcd_cmd
ldr r1, =0xd0
bl lcd_dat
ldr r1, =0x02
bl lcd_dat
ldr r1, =0x0a
bl lcd_dat
ldr r1, =0x11
bl lcd_dat
ldr r1, =0x15
bl lcd_dat
ldr r1, =0x2a
bl lcd_dat
ldr r1, =0x3d
bl lcd_dat
ldr r1, =0x53
bl lcd_dat
ldr r1, =0x42
bl lcd_dat
ldr r1, =0x16
bl lcd_dat
ldr r1, =0x0b
bl lcd_dat
ldr r1, =0x0d
bl lcd_dat
ldr r1, =0x1f
bl lcd_dat
ldr r1, =0x25
bl lcd_dat
ldr r0, =0xe1
bl lcd_cmd
ldr r1, =0xd0
bl lcd_dat
ldr r1, =0x02
bl lcd_dat
ldr r1, =0x0d
bl lcd_dat
ldr r1, =0x10
bl lcd_dat
ldr r1, =0x15
bl lcd_dat
ldr r1, =0x2a
bl lcd_dat
ldr r1, =0x3c
bl lcd_dat
ldr r1, =0x42
bl lcd_dat
ldr r1, =0x51
bl lcd_dat
ldr r1, =0x26
bl lcd_dat
ldr r1, =0x1f
bl lcd_dat
ldr r1, =0x1f
bl lcd_dat
ldr r1, =0x20
bl lcd_dat
ldr r1, =0x25
bl lcd_dat
ldr r0, =0x21
bl lcd_cmd
ldr r0, =0x2c
bl lcd_cmd
ldr r1, =0x00
bl lcd_dat
ldr r1, =0x00
bl lcd_dat
ldr r1, =0x00
bl lcd_dat
ldr r1, =0xef
bl lcd_dat
ldr r0, =0x2d
bl lcd_cmd
ldr r1, =0x00
bl lcd_dat
ldr r1, =0x00
bl lcd_dat
ldr r1, =0x00
bl lcd_dat
ldr r1, =0xef
bl lcd_dat
ldr r0, =0x00
bl lcd_cmd
ldr r0, =0x29
bl lcd_cmd
ldr r0, =0x2a
bl lcd_cmd
ldr r0, =0x2a
bl lcd_cmd
ldr r4, =240*180
ldr r5, =0xffff
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
loop:
b loop
delay:
push {lr}
0:
subs r0, #1
bne 0b
pop {pc}
lcd_rst:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
ldr r5, =0xffffffff
bic r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
orr r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
pop {r4, r5, pc}
lcd_wr:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
and r0, #0xff
lsl r0, #1
mov r5, r0
orr r5, r1
orr r5, #LCD_RST
orr r5, #LCD_RD
str r5, [r4, #PIO_DATA]
orr r5, #LCD_WR
str r5, [r4, #PIO_DATA]
pop {r4, r5, pc}
lcd_dat:
push {lr}
mov r1, #LCD_RS
bl lcd_wr
pop {pc}
lcd_cmd:
push {lr}
mov r1, #0
bl lcd_wr
pop {pc}
.end
main.ld
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
MEMORY {
ram : ORIGIN = 0x00000000, LENGTH = 32M
}
SECTIONS {
.text :
{
PROVIDE(__spl_start = .);
*(.text*)
PROVIDE(__spl_end = .);
*(.init.text)
*(.exit.text)
*(.glue*)
*(.note.gnu.build-id)
} > ram
PROVIDE(__spl_size = __spl_end - __spl_start);
.rodata ALIGN(8) :
{
PROVIDE(__rodata_start = .);
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
PROVIDE(__rodata_end = .);
} > ram
.data ALIGN(8) :
{
PROVIDE(__data_start = .);
*(.data*)
. = ALIGN(8);
PROVIDE(__data_end = .);
PROVIDE(__image_end = .);
} > ram
.bss ALIGN(8) (NOLOAD) :
{
PROVIDE(__bss_start = .);
*(.bss*)
*(.sbss*)
*(COMMON)
. = ALIGN(8);
PROVIDE(__bss_end = .);
} > ram
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
Makefile
all:
arm-none-eabi-as -mcpu=arm9 -o main.o main.s
arm-none-eabi-ld -T main.ld -o main.elf main.o
arm-none-eabi-objcopy -O binary main.elf main.bin
gcc mksunxi.c -o mksunxi
./mksunxi main.bin
ram:
sunxi-fel -p write 0 main.bin && sunxi-fel exec 0
clean:
rm -rf main.bin main.o main.elf
進入下載模式
編譯下載
$ make
arm-none-eabi-as -mcpu=arm9 -o main.o main.s
arm-none-eabi-ld -T main.ld -o main.elf main.o
arm-none-eabi-objcopy -O binary main.elf main.bin
gcc mksunxi.c -o mksunxi
./mksunxi main.bin
The bootloader head has been fixed, spl size is 1024 bytes.
$ make ram
sunxi-fel -p write 0 main.bin && sunxi-fel exec 0
100% [================================================] 1 kB, 167.0 kB/s
這...,讓司徒又陷入難點,應該是要顯示全白才對,從這個畫面顯示結果,代表屏初始化有問題,經過幾番查找,司徒發現一般屏的最後一道命令應該是0x2C,而且設定位址的命令一般是0x2A、0x2B,因此,比對了一下,司徒應該是記錯DB1和DB2的位置,導致解析錯誤
修正DB1和DB2
#!/usr/bin/python
import os
import sys
f = open('digital.csv')
c = f.readlines()
f.close()
for x in c:
l = x.replace('\r', '').replace('\n', '').split(',')
t0 = l[0]
cs = l[1]
rs = l[2]
wr = l[3]
t = l[9]
l[9] = l[10]
l[10] = t
db = '0x%02x' % int(''.join('{:x}'.format(int(v)) for v in l[4:12]), 2)
rst = l[12]
if cs == '0' and wr == '0':
if rs == '0':
print 'CMD:{}'.format(db)
else:
print 'DAT:{}'.format(db)
最後一道命令是0x2C了~
CMD:0x11
CMD:0x36
DAT:0x0a
CMD:0x3a
DAT:0x05
CMD:0x34
CMD:0x35
DAT:0x00
CMD:0xb2
DAT:0x0c
DAT:0x0c
DAT:0x00
DAT:0x33
DAT:0x33
CMD:0xb7
DAT:0x02
CMD:0xbb
DAT:0x30
CMD:0xc0
DAT:0x2c
CMD:0xc2
DAT:0x01
CMD:0xc3
DAT:0x17
CMD:0xc4
DAT:0x20
CMD:0xc6
DAT:0x0f
CMD:0xd0
DAT:0xa4
DAT:0xa1
CMD:0xd6
DAT:0xa1
CMD:0xe0
DAT:0xd0
DAT:0x04
DAT:0x0c
DAT:0x11
DAT:0x13
DAT:0x2c
DAT:0x3b
DAT:0x55
DAT:0x44
DAT:0x16
DAT:0x0d
DAT:0x0b
DAT:0x1f
DAT:0x23
CMD:0xe1
DAT:0xd0
DAT:0x04
DAT:0x0b
DAT:0x10
DAT:0x13
DAT:0x2c
DAT:0x3a
DAT:0x44
DAT:0x51
DAT:0x26
DAT:0x1f
DAT:0x1f
DAT:0x20
DAT:0x23
CMD:0x21
CMD:0x2a
DAT:0x00
DAT:0x00
DAT:0x00
DAT:0xef
CMD:0x2b
DAT:0x00
DAT:0x00
DAT:0x00
DAT:0xef
CMD:0x00
CMD:0x29
CMD:0x2c
CMD:0x2c
main.s
.global _start
.equiv PIO_BASE, 0x01c20800
.equiv PA, (0x24 * 0)
.equiv PB, (0x24 * 1)
.equiv PC, (0x24 * 2)
.equiv PD, (0x24 * 3)
.equiv PE, (0x24 * 4)
.equiv PIO_CFG0, 0x00
.equiv PIO_CFG1, 0x04
.equiv PIO_CFG2, 0x08
.equiv PIO_DATA, 0x10
.equiv LCD_CS, (1 << 21)
.equiv LCD_RD, (1 << 20)
.equiv LCD_RS, (1 << 19)
.equiv LCD_WR, (1 << 18)
.equiv LCD_RST, (1 << 0)
.arm
.text
_start:
.long 0xea000016
.byte 'e', 'G', 'O', 'N', '.', 'B', 'T', '0'
.long 0, __spl_size
.byte 'S', 'P', 'L', 2
.long 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
_vector:
b reset
b .
b .
b .
b .
b .
b .
b .
reset:
ldr r4, =PIO_BASE + PD
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PE
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PD
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
ldr r4, =PIO_BASE + PE
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
bl lcd_rst
ldr r0, =0x11
bl lcd_cmd
ldr r0, =0x36
bl lcd_cmd
ldr r0, =0x0a
bl lcd_dat
ldr r0, =0x3a
bl lcd_cmd
ldr r0, =0x05
bl lcd_dat
ldr r0, =0x34
bl lcd_cmd
ldr r0, =0x35
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xb2
bl lcd_cmd
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x33
bl lcd_dat
ldr r0, =0x33
bl lcd_dat
ldr r0, =0xb7
bl lcd_cmd
ldr r0, =0x02
bl lcd_dat
ldr r0, =0xbb
bl lcd_cmd
ldr r0, =0x30
bl lcd_dat
ldr r0, =0xc0
bl lcd_cmd
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0xc2
bl lcd_cmd
ldr r0, =0x01
bl lcd_dat
ldr r0, =0xc3
bl lcd_cmd
ldr r0, =0x17
bl lcd_dat
ldr r0, =0xc4
bl lcd_cmd
ldr r0, =0x20
bl lcd_dat
ldr r0, =0xc6
bl lcd_cmd
ldr r0, =0x0f
bl lcd_dat
ldr r0, =0xd0
bl lcd_cmd
ldr r0, =0xa4
bl lcd_dat
ldr r0, =0xa1
bl lcd_dat
ldr r0, =0xd6
bl lcd_cmd
ldr r0, =0xa1
bl lcd_dat
ldr r0, =0xe0
bl lcd_cmd
ldr r0, =0xd0
bl lcd_dat
ldr r0, =0x04
bl lcd_dat
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x11
bl lcd_dat
ldr r0, =0x13
bl lcd_dat
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0x3b
bl lcd_dat
ldr r0, =0x55
bl lcd_dat
ldr r0, =0x44
bl lcd_dat
ldr r0, =0x16
bl lcd_dat
ldr r0, =0x0d
bl lcd_dat
ldr r0, =0x0b
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x23
bl lcd_dat
ldr r0, =0xe1
bl lcd_cmd
ldr r0, =0xd0
bl lcd_dat
ldr r0, =0x04
bl lcd_dat
ldr r0, =0x0b
bl lcd_dat
ldr r0, =0x10
bl lcd_dat
ldr r0, =0x13
bl lcd_dat
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0x3a
bl lcd_dat
ldr r0, =0x44
bl lcd_dat
ldr r0, =0x51
bl lcd_dat
ldr r0, =0x26
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x20
bl lcd_dat
ldr r0, =0x23
bl lcd_dat
ldr r0, =0x21
bl lcd_cmd
ldr r0, =0x2a
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xef
bl lcd_dat
ldr r0, =0x2b
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xef
bl lcd_dat
ldr r0, =0x00
bl lcd_cmd
ldr r0, =0x29
bl lcd_cmd
ldr r0, =0x2c
bl lcd_cmd
ldr r0, =0x2c
bl lcd_cmd
ldr r4, =240*180
ldr r5, =0xffff
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
loop:
b loop
delay:
push {lr}
0:
subs r0, #1
bne 0b
pop {pc}
lcd_rst:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
ldr r5, =0xffffffff
bic r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
orr r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
pop {r4, r5, pc}
lcd_wr:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
and r0, #0xff
lsl r0, #1
mov r5, r0
orr r5, r1
orr r5, #LCD_RST
orr r5, #LCD_RD
str r5, [r4, #PIO_DATA]
orr r5, #LCD_WR
str r5, [r4, #PIO_DATA]
pop {r4, r5, pc}
lcd_dat:
push {lr}
mov r1, #LCD_RS
bl lcd_wr
pop {pc}
lcd_cmd:
push {lr}
mov r1, #0
bl lcd_wr
pop {pc}
.end
終於顯示白屏了~但是,怎麼沒有全屏?司徒往回找了一下,發現這個屏的初始化命令(解析度)竟然是使用240x240...
司徒開始探測問題,發現屏的上方有一塊區域被隱蔽(前30行)
下方也有一塊區域被隱蔽(後15行)
經過一番測試後,結論是:屏的原生解析度是240x240,不過,可視區域只有240x195,最後,屏終於可以正常控制了~
main.s
.global _start
.equiv PIO_BASE, 0x01c20800
.equiv PA, (0x24 * 0)
.equiv PB, (0x24 * 1)
.equiv PC, (0x24 * 2)
.equiv PD, (0x24 * 3)
.equiv PE, (0x24 * 4)
.equiv PIO_CFG0, 0x00
.equiv PIO_CFG1, 0x04
.equiv PIO_CFG2, 0x08
.equiv PIO_DATA, 0x10
.equiv LCD_CS, (1 << 21)
.equiv LCD_RD, (1 << 20)
.equiv LCD_RS, (1 << 19)
.equiv LCD_WR, (1 << 18)
.equiv LCD_RST, (1 << 0)
.arm
.text
_start:
.long 0xea000016
.byte 'e', 'G', 'O', 'N', '.', 'B', 'T', '0'
.long 0, __spl_size
.byte 'S', 'P', 'L', 2
.long 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
.long 0, 0, 0, 0, 0, 0, 0, 0
_vector:
b reset
b .
b .
b .
b .
b .
b .
b .
reset:
ldr r4, =PIO_BASE + PD
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PE
ldr r1, =0x11111111
str r1, [r4, #PIO_CFG0]
str r1, [r4, #PIO_CFG1]
str r1, [r4, #PIO_CFG2]
ldr r4, =PIO_BASE + PD
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
ldr r4, =PIO_BASE + PE
ldr r1, =0xffffffff
str r1, [r4, #PIO_DATA]
bl lcd_rst
ldr r0, =0x11
bl lcd_cmd
ldr r0, =0x36
bl lcd_cmd
ldr r0, =0x0a
bl lcd_dat
ldr r0, =0x3a
bl lcd_cmd
ldr r0, =0x05
bl lcd_dat
ldr r0, =0x34
bl lcd_cmd
ldr r0, =0x35
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xb2
bl lcd_cmd
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x33
bl lcd_dat
ldr r0, =0x33
bl lcd_dat
ldr r0, =0xb7
bl lcd_cmd
ldr r0, =0x02
bl lcd_dat
ldr r0, =0xbb
bl lcd_cmd
ldr r0, =0x30
bl lcd_dat
ldr r0, =0xc0
bl lcd_cmd
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0xc2
bl lcd_cmd
ldr r0, =0x01
bl lcd_dat
ldr r0, =0xc3
bl lcd_cmd
ldr r0, =0x17
bl lcd_dat
ldr r0, =0xc4
bl lcd_cmd
ldr r0, =0x20
bl lcd_dat
ldr r0, =0xc6
bl lcd_cmd
ldr r0, =0x0f
bl lcd_dat
ldr r0, =0xd0
bl lcd_cmd
ldr r0, =0xa4
bl lcd_dat
ldr r0, =0xa1
bl lcd_dat
ldr r0, =0xd6
bl lcd_cmd
ldr r0, =0xa1
bl lcd_dat
ldr r0, =0xe0
bl lcd_cmd
ldr r0, =0xd0
bl lcd_dat
ldr r0, =0x04
bl lcd_dat
ldr r0, =0x0c
bl lcd_dat
ldr r0, =0x11
bl lcd_dat
ldr r0, =0x13
bl lcd_dat
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0x3b
bl lcd_dat
ldr r0, =0x55
bl lcd_dat
ldr r0, =0x44
bl lcd_dat
ldr r0, =0x16
bl lcd_dat
ldr r0, =0x0d
bl lcd_dat
ldr r0, =0x0b
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x23
bl lcd_dat
ldr r0, =0xe1
bl lcd_cmd
ldr r0, =0xd0
bl lcd_dat
ldr r0, =0x04
bl lcd_dat
ldr r0, =0x0b
bl lcd_dat
ldr r0, =0x10
bl lcd_dat
ldr r0, =0x13
bl lcd_dat
ldr r0, =0x2c
bl lcd_dat
ldr r0, =0x3a
bl lcd_dat
ldr r0, =0x44
bl lcd_dat
ldr r0, =0x51
bl lcd_dat
ldr r0, =0x26
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x1f
bl lcd_dat
ldr r0, =0x20
bl lcd_dat
ldr r0, =0x23
bl lcd_dat
ldr r0, =0x21
bl lcd_cmd
ldr r0, =0x2a
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xef
bl lcd_dat
ldr r0, =0x2b
bl lcd_cmd
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0x00
bl lcd_dat
ldr r0, =0xef
bl lcd_dat
ldr r0, =0x00
bl lcd_cmd
ldr r0, =0x29
bl lcd_cmd
ldr r0, =0x2c
bl lcd_cmd
ldr r0, =0x2c
bl lcd_cmd
ldr r4, =240*30
ldr r5, =0xffff
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
ldr r4, =240*65
ldr r5, =0xf800
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
ldr r4, =240*65
ldr r5, =0x7e0
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
ldr r4, =240*65
ldr r5, =0x1f
0:
lsr r0, r5, #8
bl lcd_dat
mov r0, r5
bl lcd_dat
subs r4, #1
bne 0b
loop:
b loop
delay:
push {lr}
0:
subs r0, #1
bne 0b
pop {pc}
lcd_rst:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
ldr r5, =0xffffffff
bic r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
orr r5, #LCD_RST
str r5, [r4, #PIO_DATA]
ldr r0, =10000
bl delay
pop {r4, r5, pc}
lcd_wr:
push {r4, r5, lr}
ldr r4, =PIO_BASE + PD
and r0, #0xff
lsl r0, #1
mov r5, r0
orr r5, r1
orr r5, #LCD_RST
orr r5, #LCD_RD
str r5, [r4, #PIO_DATA]
orr r5, #LCD_WR
str r5, [r4, #PIO_DATA]
pop {r4, r5, pc}
lcd_dat:
push {lr}
mov r1, #LCD_RS
bl lcd_wr
pop {pc}
lcd_cmd:
push {lr}
mov r1, #0
bl lcd_wr
pop {pc}
.end
离线
根據此GitHub:https://github.com/ethanpierce/gamegearmicrohack
此人似乎早知道這個屏是ST7789,而經由分析結果,屏也確實是ST7789~
离线
我觉得TF卡可以不用这么麻烦,直接拆了之前的FLASH,tf卡走SPI是否可行。。。
离线
想保留原本Flash才沒有動刀,不過,如果MicroSD改造失敗,這個選項可以~
也可以共存吧,用不同的CS脚,引导的时候处理下。单独飞线这么多脚,劝退了大部分想改机的小伙伴啊。。:lol:
离线
雖然"怀旧堂"企圖想把改造難度,從中上拉到下下等級,不過,司徒今天剛好打完疫苗,請假在家休息,想測試下,手是否會有抖動的問題,因此,司徒還是按照原本計畫進行改機~
由於目標是跑GBA模擬器,因此,至少還需要4個按鍵,司徒把PD13、PD14拿出來當作按鍵使用
膠帶固定
接著安裝MicroSD
MicroSD腳位對應圖
MicroSD使用4bits模式,PE2、PE3也拉出來當做按鍵使用
總共跳了10根線
MicroSD VDD、GND接到Flash IC
四顆按鍵
固定FPC,避免損壞
肉雞定位完成
預計擺放位置
完成開鑿
固定按鍵
背面
開始整線
整線完成
由於MicroSD位置太下方,背蓋需要動刀
上邊缺口部份,之後有時間可以使用3D列印機補齊
UART擺放在MicroSD上方
整體評分還算可以
上方醜了點
可以從MicroSD開機,終於,完美的開發機誕生~
可能有人會好奇,司徒的焊接工具是不是很高級,可以飛出那麼細的線,其實,司徒使用很便宜的焊槍,而且也用了快五年~
銲錫的部份,使用比較好一點點的日本制銲錫~
离线
司徒老兄看样子最近比较闲了,高产ing
离线
量測後的對應腳位
Game Gear Micro | F1C200S
----------------+--------
UP | PE5
DOWN | PE7
LEFT | PE6
RIGHT | PE8
START(BLUE) | PE11
1 | PE9
2 | PE10
L1(MOD) | PE2
R1(MOD) | PD13
SELECT(MOD) | PE3
START(MOD) | PD14
LCD RST | PD0
LCD DB0 | PD1
LCD DB1 | PD2
LCD DB2 | PD3
LCD DB3 | PD4
LCD DB4 | PD5
LCD DB5 | PD6
LCD DB6 | PD7
LCD DB7 | PD8
LCD TE | PD9
LCD BL | PE12
FLASH MOSI | PC3
FLASH MISO | PC2
FLASH CS | PC1
FLASH SCK | PC0
离线
大佬有没有研究过炬力平台的掌机?比如山寨psp(atj227X系列的cpu)?
离线
@司徒
哈!真的开始弄GGM了,这个非常期待,可能成为最小的开源小机机,国外在不改动机的情况下,好像能拷入少量仅.gg游戏,且每次需线刷换游戏,还是麻烦。让GGM更大的发挥还是需增加卡槽的必要,司徒大哥给力!
离线
跟着大神的步伐!或者可加快点,我这小白程序看不懂,哈!!有空我看看这个肩键,能否加。:)
最近编辑记录 huanxing (2022-03-21 20:41:48)
离线
@mrnull
之前有研究過,可惜沒有過多資料被公開,只能放生~@huanxing
故意搞一個很難的改機,沒有人可以跟上,所以我就可以慢慢搞~
司徒最近有空了?
离线
我菜发现这个帖子,这个掌机的改机难度对于我这种普通人来说就是噩梦级
这个分辨率是不是只能移植gb模拟器,snk模拟器不行?我看有两个按钮和按钮上方的start键,
玩mslug还可以,对应子弹+跳+炸弹,start即使不对应炸弹,2个按钮也能凑合玩,就是分辨率不太合适是吧
离线
@司徒
如按国外那方案刷过系统的情况后,对你这双系统启动会否兼容
离线
@mrnull
之前有研究過,可惜沒有過多資料被公開,只能放生~
@司徒
那大佬搞搞gpi case要不?
离线
@司徒
这贴看你暂缓很久没更新了!
离线
串口有PCB焊點
今年剛滿20歲~
技术流啊 20岁 就这么厉害 我正好是你的一倍 哈哈
离线
@xiaoyu356
其實我算錯了,我今年才剛滿18歲~
今天是一年一度的端午佳節,司徒在此祝福大家端午佳節愉快~
司徒潛入深山修行許久,昨天才剛剛出關,回家路上遇到一位老人,老人看著司徒三秒後,繼續玩著他的GGM掌機,司徒這時才恍然大悟,原來還有一個東西尚未完成,於是,司徒使出出奶的力氣,挖糞圖牆,終於,看到一道成功的曙光~
GGM BTN:https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_btn_test_20220603.img.7z
這個項目目前已經接近完成的狀態,司徒先放出按鍵測試燒錄鏡像,供有興趣改機研究的朋友使用,刷入後,開機就可以看到小企鵝
按鍵測試會顯示在屏幕上
离线
很开心,又见司徒继续发力了,端午节快乐!
离线
@huanxing
感謝支持~
司徒發覺有必要先把FrameBuffer的東西紀錄下來,當作以後的參考資料,因為GGM的屏是一個很奇耙的設計,解析度是240x240,但是,顯示區域則是240x195,為此,司徒在FrameBuffer驅動做了一些處理,從下圖司徒畫的圖可以看到,F1C100S的TCON0是以240x240做更新處理,DEBE則使用4個Layers做處理,解析度都是240x240,資料輸出給屏的機制是使用TE中斷腳位觸發,因此,保證從F1C100S給的資料不會有Buffer覆蓋問題(閃屏),但是,最後回報給User Application則是240x195
為何是以240x195回報給User Application呢?因為,有效顯示區域只有240x195,為了不讓User Application花費多餘力氣處理偏移問題,這也是為何Linux Logo可以正確顯示在GGM屏幕顯示區域的原因,因此,SDL程式可以直接使用240x195製作
#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
int main(int argc, char** argv)
{
SDL_Rect rt={0};
SDL_Surface* screen;
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(240, 195, 16, SDL_SWSURFACE);
SDL_FillRect(screen, &screen->clip_rect, SDL_MapRGB(screen->format, 0xff, 0x00, 0x00));
rt.x = 50;
rt.y = 50;
rt.w = 30;
rt.h = 30;
SDL_FillRect(screen, &rt, SDL_MapRGB(screen->format, 0x00, 0xff, 0x00));
rt.x = 100;
rt.y = 100;
rt.w = 50;
rt.h = 80;
SDL_FillRect(screen, &rt, SDL_MapRGB(screen->format, 0x00, 0x00, 0xff));
SDL_Flip(screen);
SDL_Delay(3000);
SDL_Quit();
return 0;
}
編譯好的程式還需要設定如下3個環境變數:
# export SDL_NOMOUSE=1
# export SDL_FB_BROKEN_MODES=1
# export SDL_VIDEODRIVER=fbcon
SDL_NOMOUSE:不需要檢查滑鼠
SDL_FB_BROKEN_MODES:將240x195解析度加入預設清單
SDL_VIDEODRIVER:顯示驅動使用FrameBuffer
完成
P.S. 對於需要Double Buffer或者Quadruple Buffer則需要自己做Map
离线
高手啊,这个改造难度我只能看看,
所以我最想知道的是到底有没有人 能做到和司徒一样的改造...^_^
离线
厉害,司徒哥永远不缺惊喜!
离线
@司徒
看你说用SPI 4bits模式,但看到你卡座的引线1和8脚也接上?
离线
嗯,SD模式的4bitS
离线
@司徒
最终是开机有选项选择启动原机或你的制作的系统吧?
离线
记得你做竖米双系统时是有开机插拔卡的操作的。这机不涉及,那我就放心把卡口弄在电池仓了,以免过多破坏原外观。
离线
@司徒
我的刚焊好测试不正常,企鹅画面显斜纹抖动情况
离线
@huanxing
驚!竟然真的有人改機~我來想想如何搞壞你的機器~
將這個檔案燒錄到MicroSD
https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_lcd_test_20220609.img
看看開機後是不是這個畫面
兩個方向定位問題:
1. 硬件:如果畫面一樣有問題,那應該是焊接短路問題
2. 軟件:如果畫面正常,那是屏的參數有差異
离线
@司徒
这个可以,开始为下拉渐进式覆盖花屏的过程,正常吧?
离线
仔細觀察那個企鵝的畫面, 不知道大家有無發現,那個畫面有一半是亂掉的, 司徒心想~這應該就是乱马1/2的問題~
為了解乱马1/2的問題, 我調整了下屏的參數, 你測試下如下檔案:
https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_btn_test_20220610.img.7z
离线
这个刷机包正常了。最难的卡座接入项我已完成了,接下来就是4个键的安装了。司徒这改机贴是焊技的高级篇了,真会难倒一些人,我花了点时间总算跟上了。提示有兴趣改机的朋友们,备好特尖烙铁头、焊膏、0.1mm跳线、放大镜还有眼药水,开始探索你的微观世界吧。接下来看谁还跟上的,报到分享下普升高级焊师的喜悦。感谢司徒总给我们好玩的东西!
最近编辑记录 huanxing (2022-06-10 18:33:09)
离线
我的终于改机完成,接下来继续期待司徒的进展了!
最近编辑记录 huanxing (2022-06-17 13:33:45)
离线
@司徒
这次我没做打印件。完全是废物塑料手工打磨制作的,我到时把键做个模文件分享下吧
离线
@huanxing
好的, 沒問題~
GitHub資源:https://github.com/steward-fu/ggm/releases
GGM燒錄檔案:https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_linux_sd_20220618.img.7z
目前司徒已經完成Game Gear Micro掌機的第一版Linux系統,雖然改機難度有點偏高,不過,司徒還是相當推薦喜歡改機的愛好者可以動手試試,那種樂趣只有自己體驗過才懂得,而基於開源精神,司徒目前已經把所有源代碼發布在GitHub,分享給有興趣研究的開源愛好者,雖然開源並沒有強制的法律約束力,不過,司徒還是建議大家可以多多分享修改後的源代碼,這種東西或許就是我們可以傳承給下一代的好東西!司徒接著說明刷機過程和源代碼修改的部份,如果對於源代碼沒興趣的玩家,只要看前半部份的說明就可以。
刷機步驟:
1. 下載ggm_linux_sd_20220618.img.7z
2. 解壓縮ggm_linux_sd_20220618.img.7z
3. 將ggm_linux_sd_20220618.img刷到MicroSD
4. 插入MicroSD後,開機就可以看到如下畫面:
按鍵1:官方系統(NAND Flash)
按鍵2:Linux系統(MicroSD)
按下按鍵1就會進入官方系統(NAND Flash)
按下按鍵2就會進入Linux系統(MicroSD)
為了致敬SEGA,司徒將桌面拆成四個字母使用:
S:設定(Setting)
進入S後,有兩個設定可以使用,分別是亮度調整以及超頻,使用十字按鍵操作,按下藍色START按鍵會返回桌面
E:實驗(Experiment)
目前尚未完成,這部份之後會用來跑虛擬GPU實驗項目,目前司徒先放閃屏測試程式,按下藍色START按鍵會返回桌面
G:GBA模擬器(GBA Emulator)
司徒使用gpsp模擬器進行修改,為了配合GGM的屏幕特性,司徒修改很多東西,而進入GBA模擬器後,如果沒有遊戲檔案(/roms/gba/),則提示如下畫面
司徒重新改寫了載入遊戲選單,支援中文顯示,字型大小做了適當調整,每次啟動該選單時,會自動停在上次載入遊戲的位置,選單效能也進行優化,不會因為大量遊戲而造成卡頓(如PSP上面那樣),支援LR快速選單跳躍功能
GGM的屏幕顯示區域是240x195,但是,GBA解析度是240x160,因此,多餘的35像素部份,司徒使用GAME BOY ADVANCE字眼顯示
按下藍色START按鍵進入選單(按鍵1退出菜單),司徒也對菜單進行大改寫,只保留司徒覺得想要的部份
司徒也花了相當大量的時間在改善閃屏問題,司徒覺得目前狀態算是相當不錯,畫面顯示也相當柔順,如果玩家還是不滿意,建議超頻使用
A:Arduboy模擬器(Arduboy Emulator)
目前尚未完成,目前司徒先放聲音以及按鍵測試,按下藍色START按鍵會返回桌面
源代碼修改說明:
UBOOT修改部份如下
在reset時,就先跳轉到boot_menu,為何要在reset一開始就先跳轉呢?因為這是唯一一個可以轉從SPI啟動的時機
.globl reset
.globl save_boot_params_ret
.type save_boot_params_ret,%function
reset:
bl boot_menu
/* Allow the board to save important registers */
b save_boot_params
boot_menu一開始就會判斷是否從RAM執行(UBOOT Relocate後),如果是,代表UBOOT正在啟動Linux Kernel
boot_menu:
push {lr}
tst pc, #0x80000000
bne boot_linux
如果不是正在啟動Linux Kernel,則顯示開機選單,圖片位於MicroSD 2MB偏移位置
bl ccu_module_init
bl dram_module_init
bl sd_module_init
ldr r0, =IMG_BASE / 512
ldr r1, =0x80000000
ldr r2, =(2 * 1024 * 1024) / 512
bl load_image
bl lcd_init
ldr r4, =PIO_BASE + PE
0:
ldr r0, [r4, #PIO_DATA]
tst r0, #(1 << 9)
beq boot_stock
tst r0, #(1 << 10)
beq boot_linux
b 0b
如果是需要從SPI啟動,則直接呼叫BROM的SPI啟動位址,反之則直接返回原本UBOOT,繼續啟動Linux Kernel的步驟
boot_stock:
bl lcd_off
ldr pc, =0xffff4110
boot_linux:
pop {pc}
GBA模擬器修改部份,菜單源代碼替換成gui4ggm.c,原本舊的gui.c保留不動,SDL部份都改成Double Buffer
rl_screen = SDL_SetVideoMode(240, 240, 16, SDL_SWSURFACE | SDL_DOUBLEBUF);
screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 240 * video_scale, 240 * video_scale, 16, 0, 0, 0, 0);
像素搬移的部份
int x=0, y=0;
uint32_t *s = (uint32_t*)screen->pixels + (30 * 120);
uint32_t *d = (uint32_t*)rl_screen->pixels + (30 * 120);
for(y=0; y<195; y++){
for(x=0; x<120; x++){
*d++ = *s++;
}
}
VSYNC改使用IOCTL方式(司徒已經實作在Framebuffer顯示驅動中)
//delay_us((u64)virtual_frame_count * 50000 / 3 - new_ticks + 2);
if(fbdev > 0){
int zero=0;
ioctl(fbdev, FBIO_WAITFORVSYNC, &zero);
}
編譯步驟:
Miyoo編譯開發工具
$ cd
$ wget https://github.com/steward-fu/miyoo/releases/download/v1.0/toolchain.7z
$ 7za x toolchain.7z
$ sudo mv miyoo /opt/
$ export PATH=$PATH:/opt/miyoo/bin
編譯Kernel
$ cd
$ wget https://github.com/steward-fu/ggm/releases/download/src/kernel_20220618.tar.gz
$ tar xvf kernel_20220618.tar.gz
$ cd kernel
$ ./run.sh ggm
編譯UBOOT
$ cd
$ wget https://github.com/steward-fu/ggm/releases/download/src/uboot.tar.gz
$ tar xvf uboot.tar.gz
$ cd uboot
$ ./run.sh /dev/sdX ggm
編譯GBA模擬器
$ cd
$ wget https://github.com/steward-fu/ggm/releases/download/src/gpsp_20220618.tar.gz
$ tar xvf gpsp_20220618.tar.gz
$ cd gpsp/ggm
$ make -j
MicroSD佈局如下
ui:主界面顯示App
app_s:設定App(run.sh)
app_e:實驗App(run.sh)
app_g:GBA模擬器(run.sh)
app_a:Arduboy模擬器(run.sh)
rootfs:系統
mininit:由Kernel呼叫用來掛載rootfs(squashfs系統)
swap.img:虛擬內存(128MB)
音量控制是司徒失算的部份,一般音量轉盤都是直接控制大小聲音,但是GGM掌機並不是這樣設計,所以目前無法控制音量,另一部份則是電池顯示,不完美的部份就留給想要折騰的玩家,司徒接下來會把剩餘的虛擬GPU以及Arduboy模擬器完成
离线
我也没留意那转盘线路。不是直接控音频信号的大小么,难道是采集转盘的大小量再相应输出一个音频的大小量。
离线
司徒大佬你好,看了你的文章大受震撼,我是一名小白,最近做了一块全志v3s的开发板,想移植gpsp,请问gpsp的源码哪里下载,移植思路是怎样的,能否借此帖指点一下
离线
@hsinyuwang
gpsp 源代碼:https://github.com/steward-fu/miyoo/releases/download/v1.2/gpsp.7z
這個 gpsp 源代碼是當初移植給 Miyoo 使用的, 你可以從這份代碼做修改~
一般移植模擬器, 思路大致上如下步驟(不包含驅動程式部份):
1. 確定可以編譯 (交叉編譯器)
2. 確定可以顯示 (SDL)
3. 調整顯示比例
4. 調整按鍵輸入
1. 確定可以編譯 (交叉編譯器)
gpsp 源代碼解壓縮後, 可以看到 bittboy 資料夾, 複製一份成 v3s, 修改 Makefile, 3 個部份需要修改:
(1). CC 指向你的交叉編譯器
CC = arm-linux-gcc
(2). 告知 SDL.h 的位置, 一般使用 sdl-config 取得
CFLAGS += `/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/bin/sdl-config --cflags`
當然也可以使用固定路徑, 如下:
CFLAGS += -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL
(3). 告知 SDL 元件庫, 一般使用 sdl-config 取得
LIBS += `/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/bin/sdl-config --libs`
當然也可以使用固定名稱, 如下:
LIBS += -lSDL
(4). 拿到機器上跑, 確定不會有crash問題
2. 確定可以顯示 (SDL)
(1). SDL_Init() 初始化顯示驅動, 一般需要判斷回傳值是否初始化成功, 因為有時候, 顯示驅動不支援,
(2). 設定顯示解析度 SDL_SetVideoMode(), 由於這些模擬器幾乎都是從早期 320x240 顯示開始製作,
所以預設是跑 320x240, 假如你的顯示驅動只有支援 640x480, 你可以把 video_scale 設定成 2
void init_video()
{
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_NOPARACHUTE);
rl_screen = SDL_SetVideoMode(320 * video_scale, 240 * video_scale, 16, SDL_HWSURFACE);
screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 240 * video_scale, 160 * video_scale, 16, 0, 0, 0, 0);
SDL_ShowCursor(0);
}
(3). 拿到機器上跑, 確定可以顯示東西
3. 調整顯示比例
(1). flip_screen() 用來顯示模擬器的畫面, 由於經過太多人修改, 很多重複變數使用的問題, 不過這裡是你做顯示的動作, 畫面比例調整可以在這裡實做
void flip_screen()
{
...
switch(video_scale)
{
case 2:
integer_scale_horizontal(2);
break;
case 3:
integer_scale_horizontal(3);
break;
default:
case 4:
integer_scale_horizontal(4);
break;
}
for(y = 159, y2 = (160 * video_scale) - 1; y >= 0; y--)
{
for(i = 0; i < video_scale; i++)
{
memcpy(screen_ptr + (y2 * pitch),
screen_ptr + (y * pitch), 480 * video_scale);
y2--;
}
}
...
}
(2). 拿到機器上跑, 確定顯示正確
4. 調整按鍵輸入
(1). 你需要先知道 Input 驅動程式對應的按鍵值, 接著設定按鍵
#if defined(PC_BUILD)
u32 key_map(SDLKey key_sym)
{
switch(key_sym)
{
case SDLK_LSHIFT:
case SDLK_BACKSPACE:
return BUTTON_R;
case SDLK_SPACE:
case SDLK_TAB:
return BUTTON_L;
case SDLK_DOWN:
return BUTTON_DOWN;
case SDLK_UP:
return BUTTON_UP;
case SDLK_LEFT:
return BUTTON_LEFT;
case SDLK_RIGHT:
return BUTTON_RIGHT;
case SDLK_RETURN:
return BUTTON_START;
case SDLK_ESCAPE:
return BUTTON_SELECT;
case SDLK_LCTRL:
return BUTTON_B;
case SDLK_LALT:
return BUTTON_A;
default:
return BUTTON_NONE;
}
}
#endif
(2). 拿到機器上跑, 確定按鍵正確
离线
感谢回复,还有个问题,全志v3s可以直接使用miyoo toolchain中的SDL吗,还是需要自己编译SDL
离线
Miyoo 的 SDL-1.2 源代碼是使用官方的, 沒有做任何修改, Miyoo 是從顯示驅動(fbcon)和聲音驅動(alsa)做修改, 符合 SDL-1.2 的基本需求, 所以可以直接使用官方預設的源代碼, 至於, v3s 是否可以使用 ?這要看驅動程式端的製作才可以知道, 我把 SDL-1.2 和 SDL-2.0 對於顯示和聲音驅動程式的要求貼在下方, 你可以看一下, 看看是否你的 v3s 驅動程式有支援~
SDL 對於顯示驅動的需求:
SDL 對於聲音驅動的需求:
如果你的 v3s 驅動程式不符合 SDL 的基本需求, 那也可對 SDL 源代碼動刀, 就像 PSP 或者 PSVita 那樣, 不過, 那個就是另一個話題了~
离线
感谢感谢!!
离线
我在编译gpsp时遇到了这样的问题
离线
我又来求助了 编译好的gpsp该如何运行呢,我尝试执行
./gpsp [游戏文件]
出现下面的提示
另外晒下我自制的开发板(今天刚移植好infones和usb手柄,颜色还有些问题,声音滞后)
最近编辑记录 hsinyuwang (2022-07-01 19:37:33)
离线
你的聲音 freq 有點問題, 預設應該是 44K~48KHz, 所以建議直接使用 gdb debug 看問題
修改 Makefile, 把 -s 修改成 -ggdb
LIBS += -ldl -lpthread -lz -lgcov -lasound -Wl,--as-needed -Wl,--gc-sections -flto -ggdb -lpng
讓 gpsp 帶有 debug symbol (not stripped)
$ file gpsp
gpsp: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped
用 gdb 跑 gpsp, 你應該就可以馬上看到問題
# gdb --args ./gpsp xxx.gba
离线
司徒大好猛!!
我只有看到韓國的刷機軟體已經下載了,然後我手上的GGM已經賣掉了 可惜QQ
有需要我再把韓國刷機軟體提供連結
离线
国外那个软刷系统早有了,仅GG游戏,最多只能42个,并且每次6个一组开机切换,有点繁琐。加上司徒这个,都弄上就成双改机系统了。42GG+GBA游戏
离线
# ls
gba_bios.bin gpsp kdyg.gba
# ./gpsp kdyg.gba
3audio: freq 48000, size 4096
game config missing
Segmentation fault
#
离线
司徒大神 我在板子上运行就报这个错误是什么情况
离线
司徒大神 我在板子上运行就报这个错误是什么情况
大佬那个全志在线开发者论坛上看见你那个成功了,怎么弄的我也是那个问题
离线
此貼最後更新通知~
阿彌陀佛~善哉~善哉~貧僧隨風而來~隨風而去~法號~夢遺,夢遺大濕最近潛入深山修行,有天在夢中驚見 Game Gear Micro 駕鶴歸西,亡魂訴說其被司徒折騰的慘不忍睹,接近五馬分屍狀態,嚇醒夢遺大師,於是連夜奔赴尋找司徒,這才發現,原來司徒都在鬼混,好在最終司徒答應做最後更新,夢遺大濕這才放下心中大石~
前言
司徒幫 Miyoo Mini(SSD202) 上了一顆虛擬 GPU(Google SwiftShader),用來跑 PPSSPP 模擬器,原本打算再次移植給 F1C200S 使用,讓它跑 OpenGL ES 2.0 程式,可惜司徒錯估 SwiftShader 需要至少 ARMv7 才可以支援,於是司徒再度修改項目,將原本 app_e (OpenGL ES) 改成跑 GB 模擬器,而 app_a (Arduboy 模擬器) 改成跑 GBC 模擬器,這樣此貼剛好就可以做結貼的動作,真是一石二鳥之計~
關於聲音控制方式
司徒最後再度挖掘,才發現 GGM 音量轉輪是接到 PA0,透過 TouchPanel 方式輸入,利用其電壓做音量控制,修改後的 Kernel 位於:https://github.com/steward-fu/ggm/releases/download/src/kernel_20220821.tar.gz,目前已經可以控制音量大小~
app_e (GB 模擬器)
源代碼:https://github.com/steward-fu/ggm/releases/download/src/gambatte_20220821.tar.gz
編譯後:https://github.com/steward-fu/ggm/releases/download/v1.0/app_e_20220821.tar.gz
玩家只要將編譯後的檔案解壓縮到 app_e 資料夾就可以,接著執行如下程式
司徒將 GBA 的選單拿來重複使用,因此,字型大小算是相當剛好 (遊戲請放在 roms/gb 資料夾)
司徒保留 GB 的 BIOS 開機畫面,每次看到這個畫面總是相當懷念~
司徒打包了很多調色盤以供使用,因此,有相當多調色盤可以好好試試~
別有一番風味~
app_a (GBC 模擬器)
源代碼:https://github.com/steward-fu/ggm/releases/download/src/gambatte_20220821.tar.gz
編譯後:https://github.com/steward-fu/ggm/releases/download/v1.0/app_a_20220821.tar.gz
玩家只要將編譯後的檔案解壓縮到 app_a 資料夾就可以,接著執行如下程式
字型大小算是相當剛好 (遊戲請放在 roms/gbc 資料夾)
保留 GBC 的 BIOS 開機畫面,是不是相當懷念~哈~
如果玩家有注意到,司徒將 GB 的外框往上移動,GBC 則是往下移動,這樣看起來是不是更有感覺呢~哈~
菜單都是使用藍色按鍵做設定~
基於開源精神,司徒將所有源代碼放在GitHub(https://github.com/steward-fu/ggm),如果有興趣搗鼓的玩家,歡迎繼續把玩,而基於開源精神,司徒也希望大家可以將修改後的源代碼再次公開,有助於開源的發展,最後,司徒相當感謝大家對於此貼的厚愛,司徒在此至上謝意,此貼將不在更新技術部份,而對於問題仍會持續回覆,感謝~
离线
感谢司徒又来一波惊喜,之前还真有想这小机能玩GB/GBC也不错,因实在小,这瞎眼屏观看图像细致不高的游戏更适合,能否选择设置为全屏,眼睛就不用睁那么大了?哈,这小鸡可玩性又提高了!
最近编辑记录 huanxing (2022-08-21 17:15:20)
离线
请问一下怎么能加你好友,huanxing大哥,有事找你帮帮忙,谢谢
离线
司徒大佬,我编译的gpsp可以正常显示了,然后usb接了一个xbox手柄,/dev/input/下能够显示js0
那么接下来我该如何修改key_map使其能够支持xbox手柄呢?
离线
想请教个问题,在编译gngeo时报错,是需要在buildroot中开启opengl吗,找了好久没找到在哪启用opengl
离线
@hsinyuwang
不好意思, 之前的訊息沒有看到, 我一起回覆~
key_map的部份, 位於conf.c
69 #if defined(GP2X) || defined(WIZ)
70 static char * default_p1control = "UP=J0B0,DOWN=J0B4,LEFT=J0B2,RIGHT=J0B6,A=J0B14,B=J0B13,C=J0B12,D=J0B15,COIN=J0B9,START=J0B8,HOTKEY1=J0B10,HOTKEY2=J0B11";
71 static char * default_p2control = "";
72 #elif defined(PANDORA)
73 static char * default_p1control = "A=K281,B=K279,C=K278,D=K280,START=K308,COIN=K306,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K32";
74 static char * default_p2control = "";
75 #elif defined (DINGUX)
76 static char * default_p1control = "A=K308,B=K306,C=K304,D=K32,START=K13,COIN=K9,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K113";
77 static char * default_p2control = "";
78 #elif defined (WII)
79 static char *default_p1control = "A=J0B9,B=J0B10,C=J0B11,D=J0B12,START=J0B18,COIN=J0B17,UPDOWN=J0A1,LEFTRIGHT=J0A0,JOY=J0H0";
80 static char *default_p2control = "....";
81 #else
82 //static char * default_p1control = "A=K119,B=K120,C=K113,D=K115,START=K38,COIN=K34,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K27";
83 static char * default_p1control = "A=K306,B=K308,C=K32,D=K304,START=K13,COIN=K27,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K305";
84 static char * default_p2control = "";
85 #endif
P.S. 如果你不知道你的按鍵對應的數值, 你可以在收到SDL_PollEvent()後, 把數值列印出來
關於GL問題, 你可以從config.h直接關閉
47 /* Define to 1 if you have the <GL/gl.h> header file. */
48 #define HAVE_GL_GL_H 1
离线
感谢解答,目前可以正常玩耍了
但是,游戏列表的中文会显示成 “?”,菜单中的汉字没有问题
需要怎么配置
离线
司徒大神,求肋,
我把gpsp移值到stm32mp157这个芯片上,运行时出现
game config missing
Illegal instruction
是什么原因?
离线