您尚未登录。

楼主 # 2022-03-08 08:08:44

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

研究Game Gear Micro掌機的開源可行性

什麼!司徒你又開了一個新帖~不是要研究草食系統嗎?難道,草食系統已經進入生命結束前必須完成的作品之中嗎?這...不好說~司徒把這個帖子看待成番外篇,番外的特性就是盡量不要引起外人注意就草草結束~此時,邪惡的鍵盤俠可能要說:司徒的話如果可以信,狗屎都可以吃了,坦白說,司徒的話確實可以信的,狗屎也確實是可以吃的~


番外篇的目標如下
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 

正面
1.jpg


下邊
2.jpg


側邊
3.jpg


上邊
4.jpg


側邊
5.jpg


精美的包裝盒,真像以前購買GB卡帶的感覺...
1.jpg


背面
2.jpg


主機
3.jpg


相較於PocketGo的大小
4.jpg


正面
5.jpg


背面
6.jpg


PCB主板
7.jpg


Allwinner F1C200S
8.jpg


8006UL LD53EG(聲音放大)
9.jpg


PCB正面
10.jpg


XT26G01AWSEGA
11.jpg


X1308V0 20200727
12.jpg


屏24Pin
13.jpg


ALT-013BSLN-J2
14.jpg


喇叭
15.jpg


有落塵可能
16.jpg
17.jpg


B面
18.jpg


AAAx2
19.jpg


軟膠墊
20.jpg


DPad中心支撐在軟膠墊上
21.jpg

离线

楼主 #4 2022-03-08 15:35:22

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@jordonwu
串口有PCB焊點

@bigbigcong
今年剛滿20歲~

离线

楼主 #6 2022-03-08 21:22:50

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@tigger
老骨头總是有相同的默契~哈~


UART位置
1.jpg


跳線
2.jpg


連接UART
3.jpg


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:

离线

楼主 #7 2022-03-09 07:24:43

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

進入Flash Mode(按住按鍵,然後插入USB)
1.jpg


偵測到的裝置

$ lsusb
  Bus 001 Device 008: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode

离线

楼主 #8 2022-03-13 20:08:59

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

司徒想了想,發現有一個位置可以用來擺放MicroSD
1.jpg


F1C200S左邊是屏的走線,右邊則是用來跳線連接MicroSD,這改機難度屬於中上...
2.jpg


為了方便跳線,司徒先將10uPF、1M電阻拆掉
3.jpg


原本想直接使用MicroSD元件,但是,發現接觸的排針會脫落,需要固定,因此,司徒找來一個肉雞
4.jpg


電宰後...
5.jpg


相當完美的位置
6.jpg


但是,下方是屏的走線,假如先改造MicroSD,這屏的問題可能就很難解
7.jpg


因此,司徒打算先把屏的初始化代碼找出來,於是開始刮線
8.jpg


腳位圖
9.jpg


標示位置
10.jpg


跳線
11.jpg


屏的走線真的蠻細的,需要一點苦工,司徒一想到後面的MicroSD跳線,有種想哭的感覺...
12.jpg


寨機邏輯分析儀上場
13.jpg


由上而下分別是:CS、RD、RS、WR、PD0、DB0~DB7、PD8,從這個圖,得到四個資訊:
1. 屏的驅動方式是MCU方式(i80)
2. 屏有TE腳位(Screen Tearing)
3. PD0是TE腳位
4. PD8是RESET腳位
14.jpg


TE腳位剛好是60Hz,代表這個屏的顯示可以達60FPS,相當不錯的屏
15.jpg


邏輯分析儀取得的資料

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

進入下載模式
17.jpg


編譯下載

$ 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的位置,導致解析錯誤
16.jpg


修正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...
18.jpg


司徒開始探測問題,發現屏的上方有一塊區域被隱蔽(前30行)
19.jpg


下方也有一塊區域被隱蔽(後15行)
20.jpg


經過一番測試後,結論是:屏的原生解析度是240x240,不過,可視區域只有240x195,最後,屏終於可以正常控制了~
21.jpg


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

离线

楼主 #9 2022-03-14 07:25:50

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

根據此GitHub:https://github.com/ethanpierce/gamegearmicrohack
此人似乎早知道這個屏是ST7789,而經由分析結果,屏也確實是ST7789~

离线

楼主 #11 2022-03-14 09:54:27

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

想保留原本Flash才沒有動刀,不過,如果MicroSD改造失敗,這個選項可以~

离线

楼主 #13 2022-03-14 11:15:51

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

聽君一席話,更勝十年書~

离线

楼主 #14 2022-03-14 16:35:23

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

雖然"怀旧堂"企圖想把改造難度,從中上拉到下下等級,不過,司徒今天剛好打完疫苗,請假在家休息,想測試下,手是否會有抖動的問題,因此,司徒還是按照原本計畫進行改機~


由於目標是跑GBA模擬器,因此,至少還需要4個按鍵,司徒把PD13、PD14拿出來當作按鍵使用
1.jpg


膠帶固定
2.jpg


接著安裝MicroSD
3.jpg


MicroSD腳位對應圖
22.jpg


MicroSD使用4bits模式,PE2、PE3也拉出來當做按鍵使用
4.jpg


總共跳了10根線
5.jpg


MicroSD VDD、GND接到Flash IC
6.jpg


四顆按鍵
7.jpg


固定FPC,避免損壞
8.jpg


肉雞定位完成
9.jpg


預計擺放位置
10.jpg


完成開鑿
11.jpg


固定按鍵
12.jpg


背面
13.jpg


開始整線
14.jpg


整線完成
15.jpg


由於MicroSD位置太下方,背蓋需要動刀
16.jpg


上邊缺口部份,之後有時間可以使用3D列印機補齊
17.jpg


UART擺放在MicroSD上方
18.jpg


整體評分還算可以
19.jpg


上方醜了點
20.jpg


可以從MicroSD開機,終於,完美的開發機誕生~
21.jpg


可能有人會好奇,司徒的焊接工具是不是很高級,可以飛出那麼細的線,其實,司徒使用很便宜的焊槍,而且也用了快五年~
1_20220314-1630.jpg


銲錫的部份,使用比較好一點點的日本制銲錫~
2_20220314-1631.jpg

离线

楼主 #15 2022-03-14 20:59:56

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

洞口太大,司徒決定修補一下
23.jpg


OpenSCAD

difference(){
  cube([16, 6.5, 2]);
  translate([2, 4, 0]){
    cube([8, 2, 3]);
  }
  translate([2, 2, 0]){
    cube([12, 2, 3]);
  }
}
cube([18, 2.5, 2]);

預覽圖
24.jpg


3D列印
25.jpg


相當合適的大小
26.jpg


完美的修補
27.jpg


相當工整
28.jpg


插入MicroSD也沒有凸出
29.jpg

离线

楼主 #17 2022-03-15 20:59:55

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@hox
哈哈~


其實最難的地方是飛線,一旦飛線完成,接下來就是慢慢體驗美好的果實~
司徒目前開始製作多重開機選單,一個是原廠系統,另一個則是跑GBA模擬器
bg.png
1_20220315-2057.jpg

离线

楼主 #18 2022-03-16 08:42:08

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

量測後的對應腳位

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

离线

楼主 #21 2022-03-21 19:08:44

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@mrnull
之前有研究過,可惜沒有過多資料被公開,只能放生~

@huanxing
故意搞一個很難的改機,沒有人可以跟上,所以我就可以慢慢搞~

离线

楼主 #24 2022-03-22 13:01:13

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
OK

@鳝丝与螺丝
最近有些事情要處理~沒有空~

离线

楼主 #27 2022-03-24 10:29:55

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@fullniz
我目標只有GBA模擬器,不過,結束後,我會全部開源出來給大家使用,如果想搗鼓,可以先改機~

@huanxing
NAND Flash我不會去動它,預設使用MicroSD開機,開機後,可以選擇從NAND或MicroSD進入系統,所以國外那個方案可以使用的~

离线

楼主 #29 2022-03-26 11:46:21

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@mrnull
沒興趣~

离线

楼主 #30 2022-04-21 21:13:37

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@哇酷小二
圖片問題,原本不想再更新了~但是,竟然修好了~哈哈~太感謝了,小弟會繼續更新的~哈哈

离线

楼主 #32 2022-05-03 13:11:42

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
在等我一會兒~

离线

楼主 #34 2022-06-03 10:03:23

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@xiaoyu356
其實我算錯了,我今年才剛滿18歲~

今天是一年一度的端午佳節,司徒在此祝福大家端午佳節愉快~
司徒潛入深山修行許久,昨天才剛剛出關,回家路上遇到一位老人,老人看著司徒三秒後,繼續玩著他的GGM掌機,司徒這時才恍然大悟,原來還有一個東西尚未完成,於是,司徒使出出奶的力氣,挖糞圖牆,終於,看到一道成功的曙光~

GGM BTN:https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_btn_test_20220603.img.7z
這個項目目前已經接近完成的狀態,司徒先放出按鍵測試燒錄鏡像,供有興趣改機研究的朋友使用,刷入後,開機就可以看到小企鵝
1_20220603-0959.jpg


按鍵測試會顯示在屏幕上
2_20220603-0959.jpg

离线

楼主 #36 2022-06-04 09:52:04

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
感謝支持~

司徒發覺有必要先把FrameBuffer的東西紀錄下來,當作以後的參考資料,因為GGM的屏是一個很奇耙的設計,解析度是240x240,但是,顯示區域則是240x195,為此,司徒在FrameBuffer驅動做了一些處理,從下圖司徒畫的圖可以看到,F1C100S的TCON0是以240x240做更新處理,DEBE則使用4個Layers做處理,解析度都是240x240,資料輸出給屏的機制是使用TE中斷腳位觸發,因此,保證從F1C100S給的資料不會有Buffer覆蓋問題(閃屏),但是,最後回報給User Application則是240x195
1_20220604-0955.jpg


為何是以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


完成
2_20220604-0951.jpg
P.S. 對於需要Double Buffer或者Quadruple Buffer則需要自己做Map

离线

楼主 #38 2022-06-05 09:27:22

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

為了致敬SEGA,司徒最後決定加開項目,開機畫面如下,共四個選項:
9_20220605-0921.jpg
S: 設定 (Setting)
E: 實驗 (Experiment)
G: GBA 模擬器
A: Arduboy 模擬器

P.S. 實驗項目是司徒的一個心願,司徒要幫ARM9 F1C100S上一顆虛擬GPU,用來跑OpenGL ES的程序~


目前GBA模擬器已經可以跑了,正在收尾~
10_20220605-0921.jpg
11_20220605-0921.jpg
12_20220605-0921.jpg
13_20220605-0921.jpg

离线

楼主 #41 2022-06-05 13:01:24

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
目前使用4bits方式連接,腳位如下:
PD13: 按鍵R1
PD14: 按鍵Start
PE2: 按鍵L1
PE3: 按鍵Select
PF0: MicroSD D1
PF1: MicroSD D0
PF2: MicroSD CLK
PF3: MicroSD CMD
PF4: MicroSD D3
PF5: MicroSD D2

9.jpg

离线

楼主 #44 2022-06-06 21:05:31

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
對~透過MicroSD開機時,會有選單可以選擇要進入哪個系統~

离线

楼主 #47 2022-06-09 17:12:56

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
驚!竟然真的有人改機~我來想想如何搞壞你的機器~

將這個檔案燒錄到MicroSD
https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_lcd_test_20220609.img


看看開機後是不是這個畫面
21.jpg


兩個方向定位問題:
1. 硬件:如果畫面一樣有問題,那應該是焊接短路問題
2. 軟件:如果畫面正常,那是屏的參數有差異

离线

楼主 #49 2022-06-10 13:54:11

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

仔細觀察那個企鵝的畫面, 不知道大家有無發現,那個畫面有一半是亂掉的, 司徒心想~這應該就是乱马1/2的問題~

為了解乱马1/2的問題, 我調整了下屏的參數, 你測試下如下檔案:
https://github.com/steward-fu/ggm/releases/download/v1.0/ggm_btn_test_20220610.img.7z

离线

楼主 #51 2022-06-13 10:25:48

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
相當棒的手藝,感謝分享,之後的測試就可以跟你一起測試了,太棒了!目前我正在用多重開機部分~

离线

楼主 #53 2022-06-17 14:08:13

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
漂亮~這個改機可以給100分!
司徒最近正在追韓劇, 心想你應該需要一段時間才可以改機完成, 想不到如此快速就改機完成, 等我把韓劇追完在給你測試檔案~哈~
另外, 你的那些按鈕是3D列印, 可以分享一下檔案嗎?另外, 切割的大小以及距離, 可以分享一下嗎?感謝~

离线

楼主 #55 2022-06-18 21:36:18

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@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_20220618-2117.jpg 2_20220618-2118.jpg
按鍵1:官方系統(NAND Flash)
按鍵2:Linux系統(MicroSD)


按下按鍵1就會進入官方系統(NAND Flash)
3_20220618-2119.jpg


按下按鍵2就會進入Linux系統(MicroSD)
4_20220618-2119.jpg 5_20220618-2120.jpg


為了致敬SEGA,司徒將桌面拆成四個字母使用:
6_20220618-2120.jpg 7_20220618-2121.jpg
8_20220618-2121.jpg 9_20220618-2121.jpg
10_20220618-2122.jpg 11_20220618-2122.jpg
12_20220618-2122.jpg 13_20220618-2123.jpg


S:設定(Setting)
進入S後,有兩個設定可以使用,分別是亮度調整以及超頻,使用十字按鍵操作,按下藍色START按鍵會返回桌面
14_20220618-2123.jpg 15_20220618-2123.jpg


E:實驗(Experiment)
目前尚未完成,這部份之後會用來跑虛擬GPU實驗項目,目前司徒先放閃屏測試程式,按下藍色START按鍵會返回桌面
16_20220618-2124.jpg 17_20220618-2124.jpg


G:GBA模擬器(GBA Emulator)
司徒使用gpsp模擬器進行修改,為了配合GGM的屏幕特性,司徒修改很多東西,而進入GBA模擬器後,如果沒有遊戲檔案(/roms/gba/),則提示如下畫面
18_20220618-2125.jpg 19_20220618-2125.jpg


司徒重新改寫了載入遊戲選單,支援中文顯示,字型大小做了適當調整,每次啟動該選單時,會自動停在上次載入遊戲的位置,選單效能也進行優化,不會因為大量遊戲而造成卡頓(如PSP上面那樣),支援LR快速選單跳躍功能
20_20220618-2126.jpg


GGM的屏幕顯示區域是240x195,但是,GBA解析度是240x160,因此,多餘的35像素部份,司徒使用GAME BOY ADVANCE字眼顯示
21_20220618-2126.jpg


按下藍色START按鍵進入選單(按鍵1退出菜單),司徒也對菜單進行大改寫,只保留司徒覺得想要的部份
22_20220618-2127.jpg


司徒也花了相當大量的時間在改善閃屏問題,司徒覺得目前狀態算是相當不錯,畫面顯示也相當柔順,如果玩家還是不滿意,建議超頻使用
23_20220618-2128.jpg


A:Arduboy模擬器(Arduboy Emulator)
目前尚未完成,目前司徒先放聲音以及按鍵測試,按下藍色START按鍵會返回桌面
24_20220618-2128.jpg 25_20220618-2129.jpg


源代碼修改說明:
UBOOT修改部份如下
26_20220618-2129.jpg


在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佈局如下
27_20220618-2134.jpg
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模擬器完成

离线

楼主 #57 2022-06-28 18:30:40

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@huanxing
等韓劇看完, 我找時間查一下腳位, 應該是從TP進入才是~

离线

楼主 #59 2022-06-30 08:25:43

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@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). 拿到機器上跑, 確定按鍵正確

离线

楼主 #61 2022-06-30 11:39:40

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

Miyoo 的 SDL-1.2 源代碼是使用官方的, 沒有做任何修改, Miyoo 是從顯示驅動(fbcon)和聲音驅動(alsa)做修改, 符合 SDL-1.2 的基本需求, 所以可以直接使用官方預設的源代碼, 至於, v3s 是否可以使用 ?這要看驅動程式端的製作才可以知道, 我把 SDL-1.2 和 SDL-2.0 對於顯示和聲音驅動程式的要求貼在下方, 你可以看一下, 看看是否你的 v3s 驅動程式有支援~


SDL 對於顯示驅動的需求
1.jpeg


SDL 對於聲音驅動的需求
2.jpeg


如果你的 v3s 驅動程式不符合 SDL 的基本需求, 那也可對 SDL 源代碼動刀, 就像 PSP 或者 PSVita 那樣, 不過, 那個就是另一個話題了~

离线

楼主 #64 2022-06-30 18:01:26

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

你 v3s 跑的系統應該是使用 buildroot 編譯出來才是, 所以你需要使用那個交叉編譯器去編譯 gpsp, 因為那才會包含需要的元件庫, linaro 這種編譯器只是標準的交叉編譯器, 並不會包含 SDL 相關的元件庫~

离线

楼主 #66 2022-07-02 10:53:51

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

你的聲音 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

离线

楼主 #72 2022-08-07 10:20:25

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@鱼尾 @黑蛋
如果直接執行可能缺少SDL設定, 試試如下:

# export SDL_NOMOUSE=1
# ./gpsp kdyg.gba

當然也可以直接使用gdb看問題, 會比較快~

离线

楼主 #73 2022-08-21 14:36:38

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

此貼最後更新通知~
阿彌陀佛~善哉~善哉~貧僧隨風而來~隨風而去~法號~夢遺,夢遺大濕最近潛入深山修行,有天在夢中驚見 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 資料夾就可以,接著執行如下程式
1_20220821-1418.jpg


司徒將 GBA 的選單拿來重複使用,因此,字型大小算是相當剛好 (遊戲請放在 roms/gb 資料夾)
2_20220821-1418.jpg


司徒保留 GB 的 BIOS 開機畫面,每次看到這個畫面總是相當懷念~
3_20220821-1418.jpg


司徒打包了很多調色盤以供使用,因此,有相當多調色盤可以好好試試~
4_20220821-1419.jpg


別有一番風味~
5_20220821-1419.jpg


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 資料夾就可以,接著執行如下程式
6_20220821-1419.jpg


字型大小算是相當剛好 (遊戲請放在 roms/gbc 資料夾)
7_20220821-1419.jpg


保留 GBC 的 BIOS 開機畫面,是不是相當懷念~哈~
8_20220821-1419.jpg


如果玩家有注意到,司徒將 GB 的外框往上移動,GBC 則是往下移動,這樣看起來是不是更有感覺呢~哈~
9_20220821-1420.jpg


菜單都是使用藍色按鍵做設定~
10_20220821-1420.jpg


基於開源精神,司徒將所有源代碼放在GitHub(https://github.com/steward-fu/ggm),如果有興趣搗鼓的玩家,歡迎繼續把玩,而基於開源精神,司徒也希望大家可以將修改後的源代碼再次公開,有助於開源的發展,最後,司徒相當感謝大家對於此貼的厚愛,司徒在此至上謝意,此貼將不在更新技術部份,而對於問題仍會持續回覆,感謝~

离线

楼主 #75 2022-08-21 18:03:30

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

哈~你這個主意我喜歡~那...我們就等待下一個勇者來解決吧~哈

离线

楼主 #77 2022-09-06 15:23:47

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

QQ: 3164135789

由於某些喜歡黑人的奸商,我現在很少上QQ了,不過這個應該是目前可以找到我的地方,上線時間都是隨緣的~
有問題,還是可以在我的whycan相關貼子留言,我盡可能回覆~

离线

楼主 #80 2022-10-20 07:27:59

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

@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

离线

楼主 #82 2022-10-24 08:31:14

司徒
Moderator
注册时间: 2020-02-13
已发帖子: 547
积分: 157
个人网站

Re: 研究Game Gear Micro掌機的開源可行性

你需要把 *.ttf 字型檔案也放在一起~

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn