1 /*
2  * libtilemcore - Graphing calculator emulation library
3  *
4  * Copyright (C) 2001 Solignac Julien
5  * Copyright (C) 2004-2012 Benjamin Moody
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifdef HAVE_CONFIG_H
23 # include <config.h>
24 #endif
25 
26 #include <stdio.h>
27 #include <tilem.h>
28 
29 #include "xz.h"
30 
31 static const TilemFlashSector flashsectors[] = {
32 	{0x000000, 0x10000, 0}, {0x010000, 0x10000, 0},
33 	{0x020000, 0x10000, 0},	{0x030000, 0x10000, 0},
34 	{0x040000, 0x10000, 0},	{0x050000, 0x10000, 0},
35 	{0x060000, 0x10000, 0},	{0x070000, 0x10000, 0},
36 	{0x080000, 0x10000, 0},	{0x090000, 0x10000, 0},
37 	{0x0A0000, 0x10000, 0},	{0x0B0000, 0x10000, 0},
38 	{0x0C0000, 0x10000, 0},	{0x0D0000, 0x10000, 0},
39 	{0x0E0000, 0x10000, 0},	{0x0F0000, 0x10000, 0},
40 	{0x100000, 0x10000, 0},	{0x110000, 0x10000, 0},
41 	{0x120000, 0x10000, 0},	{0x130000, 0x10000, 0},
42 	{0x140000, 0x10000, 0},	{0x150000, 0x10000, 0},
43 	{0x160000, 0x10000, 0},	{0x170000, 0x10000, 0},
44 	{0x180000, 0x10000, 0}, {0x190000, 0x10000, 0},
45 	{0x1A0000, 0x10000, 0}, {0x1B0000, 0x10000, 2},
46 	{0x1C0000, 0x10000, 0}, {0x1D0000, 0x10000, 0},
47 	{0x1E0000, 0x10000, 0}, {0x1F0000, 0x08000, 0},
48 	{0x1F8000, 0x02000, 0}, {0x1FA000, 0x02000, 0},
49 	{0x1FC000, 0x04000, 2}};
50 
51 #define NUM_FLASH_SECTORS (sizeof(flashsectors) / sizeof(TilemFlashSector))
52 
53 static const char* hwregnames[NUM_HW_REGS] = HW_REG_NAMES;
54 
55 static const char* hwtimernames[NUM_HW_TIMERS] = HW_TIMER_NAMES;
56 
57 extern const char* xp_keynames[];
58 
59 TilemHardware hardware_ti84pse = {
60 	'z', "ti84pse", "TI-84 Plus Silver Edition",
61 	(TILEM_CALC_HAS_LINK | TILEM_CALC_HAS_LINK_ASSIST
62 	 | TILEM_CALC_HAS_T6A04 | TILEM_CALC_HAS_FLASH
63 	 | TILEM_CALC_HAS_MD5_ASSIST),
64 	96, 64, 128 * 0x4000, 8 * 0x4000, 16 * 64, 0x80,
65 	NUM_FLASH_SECTORS, flashsectors, 3,
66 	NUM_HW_REGS, hwregnames,
67 	NUM_HW_TIMERS, hwtimernames,
68 	xp_keynames,
69 	xz_reset, xz_stateloaded,
70 	xz_z80_in, xz_z80_out,
71 	xz_z80_wrmem, xz_z80_rdmem, xz_z80_rdmem_m1, NULL,
72 	xz_z80_ptimer, tilem_lcd_t6a04_get_data,
73 	xz_mem_ltop, xz_mem_ptol };
74