@@ -100,6 +100,7 @@ emu_state_t emu_load(emu_data_t type, const char *path) {
100100 const uint8_t * data ;
101101 uint32_t outer_field_size ;
102102 uint32_t data_field_size ;
103+ ti_model_t model_id = TIMODEL_8384CE ;
103104 ti_device_t device_type = TI84PCE ;
104105 uint32_t offset ;
105106 size_t size ;
@@ -139,7 +140,8 @@ emu_state_t emu_load(emu_data_t type, const char *path) {
139140
140141 /* Inner 0x801(0) field: calculator model */
141142 if (cert_field_get (outer , outer_field_size , & field_type , & data , & data_field_size )) break ;
142- if (field_type != 0x8012 || data [0 ] != 0x13 ) break ;
143+ if (field_type != 0x8012 || (data [0 ] != TIMODEL_8384CE && data [0 ] != TIMODEL_82AEP )) break ;
144+ model_id = (ti_model_t )data [0 ];
143145
144146 /* Inner 0x802(0) field: skip. */
145147 data_field_size = outer_field_size - (data + data_field_size - outer );
@@ -179,7 +181,18 @@ emu_state_t emu_load(emu_data_t type, const char *path) {
179181 /* If we come here, we've found something. */
180182 gotType = true;
181183
182- gui_console_printf ("[CEmu] Loaded ROM Image.\n" );
184+ gui_console_printf ("[CEmu] Loaded ROM Image. \n" );
185+
186+ {
187+ static const uint16_t python_path [] = { 0x0330 , 0x0430 };
188+ bool isPython = !cert_field_find_path (mem .flash .block + 0x3B0001 , SIZE_FLASH_SECTOR_64K , python_path , 2 , NULL , NULL );
189+ gui_console_printf ("[CEmu] Info from cert: Device type = %d (%s). Model = %d (%s). Is Python? %s.\n" ,
190+ device_type , (device_type == TI84PCE ) ? "84+CE-like" : "83PCE-like" ,
191+ model_id , (model_id == TIMODEL_8384CE ) ? "CE" : "82AdvPy" ,
192+ isPython ? "Yes" : "No" );
193+ }
194+
195+
183196 break ;
184197 }
185198
0 commit comments