Skip to content

Commit 8e63527

Browse files
committed
Don't make it impossible to load a 82AEP rom.
Also display more info parsed from the cert.
1 parent 184ab7a commit 8e63527

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

core/asic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ typedef enum {
1414
TI83PCE = 1
1515
} ti_device_t;
1616

17+
typedef enum {
18+
TIMODEL_8384CE = 0x13,
19+
TIMODEL_82AEP = 0x15
20+
} ti_model_t;
21+
1722
typedef enum {
1823
ASIC_REV_AUTO = 0, /* Used only with set_asic_revision() */
1924
ASIC_REV_A = 1,

core/emu.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

gui/qt/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ void MainWindow::varSelect() {
21142114
return;
21152115
}
21162116

2117-
QStringList fileNames = varDialog(QFileDialog::AcceptOpen, tr("TI Variable (*.8xp *.8xv *.8xl *.8xn *.8xm *.8xy *.8xg *.8xs *.8xd *.8xw *.8xc *.8xl *.8xz *.8xt *.8ca *.8cg *.8ci *.8ek *.8eu *.8pu *.b84 *.b83);;All Files (*.*)"), Q_NULLPTR);
2117+
QStringList fileNames = varDialog(QFileDialog::AcceptOpen, tr("TI Variable (*.8xp *.8xv *.8xl *.8xn *.8xm *.8xy *.8xg *.8xs *.8xd *.8xw *.8xc *.8xl *.8xz *.8xt *.8ca *.8cg *.8ci *.8ek *.8yu *.8eu *.8pu *.b84 *.b83);;All Files (*.*)"), Q_NULLPTR);
21182118

21192119
sendingHandler->sendFiles(fileNames, LINK_FILE);
21202120
equatesRefresh();

gui/qt/sendinghandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static const QStringList valid_suffixes = { QStringLiteral("8xp"),
3030
QStringLiteral("8cg"),
3131
QStringLiteral("8ci"),
3232
QStringLiteral("8ek"),
33+
QStringLiteral("8yu"),
3334
QStringLiteral("8eu"),
3435
QStringLiteral("8pu"),
3536
};

0 commit comments

Comments
 (0)