Skip to content

Commit c413908

Browse files
committed
Thu 20 Feb 2020 15:35:39 EST - working on retro-go components
1 parent 7902b84 commit c413908

File tree

8 files changed

+678
-101
lines changed

8 files changed

+678
-101
lines changed

Components/retro-go/components/odroid/odroid_display.c

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ DRAM_ATTR static const ili_init_cmd_t ili_sleep_cmds[] = {
8686
};
8787

8888

89-
// 2.4" LCD
89+
/*
90+
CONFIG_LCD_DRIVER_CHIP_ODROID_GO
91+
*/
92+
#ifdef CONFIG_LCD_DRIVER_CHIP_ODROID_GO
9093
DRAM_ATTR static const ili_init_cmd_t ili_init_cmds[] = {
9194
// VCI=2.8V
9295
//************* Start Initial Sequence **********//
@@ -104,7 +107,7 @@ DRAM_ATTR static const ili_init_cmd_t ili_init_cmds[] = {
104107
//{0x36, {(MADCTL_MV | MADCTL_MX | TFT_RGB_BGR)}, 1}, // Memory Access Control
105108
{0x36, {(MADCTL_MV | MADCTL_MY | TFT_RGB_BGR)}, 1}, // Memory Access Control
106109
{0x3A, {0x55}, 1},
107-
{0xB1, {0x00, 0x10}, 2}, // Frame Rate Control (1B=70, 1F=61, 10=119)
110+
{0xB1, {0x00, 0x1B}, 2}, // Frame Rate Control (1B=70, 1F=61, 10=119)
108111
{0xB6, {0x0A, 0xA2}, 2}, // Display Function Control
109112
{0xF6, {0x01, 0x30}, 2},
110113
{0xF2, {0x00}, 1}, // 3Gamma Function Disable
@@ -119,6 +122,45 @@ DRAM_ATTR static const ili_init_cmd_t ili_init_cmds[] = {
119122

120123
{0, {0}, 0xff}
121124
};
125+
#endif
126+
/*
127+
CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32
128+
*/
129+
#ifdef CONFIG_LCD_DRIVER_CHIP_RETRO_ESP32
130+
DRAM_ATTR static const ili_init_cmd_t ili_init_cmds[] = {
131+
// VCI=2.8V
132+
//************* Start Initial Sequence **********//
133+
{TFT_CMD_SWRESET, {0}, 0x80},
134+
{0xCF, {0x00, 0xc3, 0x30}, 3},
135+
{0xED, {0x64, 0x03, 0x12, 0x81}, 4},
136+
{0xE8, {0x85, 0x00, 0x78}, 3},
137+
{0xCB, {0x39, 0x2c, 0x00, 0x34, 0x02}, 5},
138+
{0xF7, {0x20}, 1},
139+
{0xEA, {0x00, 0x00}, 2},
140+
{0xC0, {0x1B}, 1}, //Power control //VRH[5:0]
141+
{0xC1, {0x12}, 1}, //Power control //SAP[2:0];BT[3:0]
142+
{0xC5, {0x32, 0x3C}, 2}, //VCM control
143+
{0x36, {(MADCTL_MV | MADCTL_MY | TFT_RGB_BGR)}, 1}, // Memory Access Control
144+
{0x3A, {0x55}, 1},
145+
{0xB1, {0x00, 0x1B}, 2}, // Frame Rate Control (1B=70, 1F=61, 10=119)
146+
{0xB6, {0x0A, 0xA2}, 2}, // Display Function Control
147+
{0xF6, {0x01, 0x30}, 2},
148+
{0xF2, {0x00}, 1}, // 3Gamma Function Disable
149+
{0x26, {0x01}, 1}, //Gamma curve selected
150+
151+
//Set Gamma
152+
{0xE0, {0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00}, 15},
153+
{0XE1, {0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F}, 15},
154+
155+
// ILI9342 Specific
156+
{0x36, {0x40|0x80|0x08}, 1}, // <-- ROTATE
157+
{0x21, {0}, 0x80}, // <-- INVERT COLORS
158+
159+
{0x11, {0}, 0x80}, //Exit Sleep
160+
{0x29, {0}, 0x80}, //Display on
161+
{0, {0}, 0xff}
162+
};
163+
#endif
122164

123165

124166
static inline uint16_t* line_buffer_get()

Components/retro-go/components/odroid/odroid_hud.c

Lines changed: 83 additions & 84 deletions
Large diffs are not rendered by default.

Components/retro-go/components/odroid/odroid_input.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ odroid_gamepad_state odroid_input_read_raw()
6666
state.values[ODROID_INPUT_A] = !(gpio_get_level(ODROID_GAMEPAD_IO_A));
6767
state.values[ODROID_INPUT_B] = !(gpio_get_level(ODROID_GAMEPAD_IO_B));
6868

69+
#ifdef CONFIG_DEFAULT_MENU_KEY
6970
state.values[ODROID_INPUT_MENU] = !(gpio_get_level(ODROID_GAMEPAD_IO_MENU));
71+
#endif
72+
#ifdef CONFIG_COMBO_MENU_KEY
73+
state.values[ODROID_INPUT_MENU] = state.values[ODROID_INPUT_SELECT] && state.values[ODROID_INPUT_START];
74+
#endif
7075
state.values[ODROID_INPUT_VOLUME] = !(gpio_get_level(ODROID_GAMEPAD_IO_VOLUME));
7176

7277
return state;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
menu "Retro ESP32 Configuration"
2+
choice LCD_DRIVER_CHIP
3+
prompt "LCD Driver Chip"
4+
default LCD_DRIVER_CHIP_ODROID_GO
5+
help
6+
LCD Screen Driver
7+
8+
config LCD_DRIVER_CHIP_ODROID_GO
9+
bool "Odroid Go - 2.4\" [ILI9341]"
10+
11+
config LCD_DRIVER_CHIP_RETRO_ESP32
12+
bool "Retro ESP32 - 2.6\" [ILI9342]"
13+
14+
endchoice
15+
16+
choice MENU_HOT_KEYS
17+
prompt "MENU Key Options"
18+
default DEFAULT_MENU_KEY
19+
help
20+
Select Hot Key (Menu Button)
21+
22+
config DEFAULT_MENU_KEY
23+
bool "Odroid Go MENU Button"
24+
25+
config COMBO_MENU_KEY
26+
bool "START + SELECT as MENU button"
27+
28+
endchoice
29+
30+
choice IN_GAME_MENU
31+
prompt "In Game Menu"
32+
default IN_GAME_MENU_YES
33+
help
34+
Use Retro ESP32 - In Game Menu
35+
36+
config IN_GAME_MENU_YES
37+
bool "YES"
38+
39+
config IN_GAME_MENU_NO
40+
bool "NO"
41+
42+
endchoice
43+
endmenu

Components/retro-go/nesemu-go/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#
55

66
PROJECT_NAME := nesemu-go
7-
EXTRA_COMPONENT_DIRS := $(dirname "$PWD")/components
7+
8+
CWD := $(shell cd ../ && (bash -c "dirs +0"))
9+
EXTRA_COMPONENT_DIRS := ~/Desktop/github/R32/Software/Emulators/retro-go/components
10+
11+
$(info CWD is $(CWD))
12+
$(info EXTRA_COMPONENT_DIRS is $(EXTRA_COMPONENT_DIRS))
813

914
include $(IDF_PATH)/make/project.mk

0 commit comments

Comments
 (0)