Skip to content

Commit e5f9fdf

Browse files
deprecate sk_key_t
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent 49fc014 commit e5f9fdf

File tree

9 files changed

+116
-64
lines changed

9 files changed

+116
-64
lines changed

examples/graphx/tilemap/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern unsigned char tilemap_map[];
2222

2323
int main(void)
2424
{
25-
sk_key_t key;
25+
uint8_t key;
2626
unsigned int x_offset = 0;
2727
unsigned int y_offset = 0;
2828
gfx_tilemap_t tilemap;

examples/graphx/tilemap_appvar/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern unsigned char tilemap_map[];
2222

2323
int main(void)
2424
{
25-
sk_key_t key;
25+
uint8_t key;
2626
unsigned int x_offset = 0;
2727
unsigned int y_offset = 0;
2828
gfx_tilemap_t tilemap;

examples/graphx/tilemap_compressed/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ gfx_sprite_t *tileset_tiles[128];
2929

3030
int main(void)
3131
{
32-
sk_key_t key;
32+
uint8_t key;
3333
gfx_tilemap_t tilemap;
3434
gfx_sprite_t *tmp_ptr;
3535
unsigned int i;

src/ce/include/ti/error.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,20 @@ int os_PushErrorHandler(void) __attribute__((returns_twice));
5353
*/
5454
void os_PopErrorHandler(void);
5555

56-
#define os_AppErr1 ((char*)0xD025A9) /**< String [1] for custom error */
57-
#define os_AppErr2 ((char*)0xD025B6) /**< String [2] for custom error */
56+
/**
57+
* String for custom error.
58+
* Can be used by calling `os_ThrowError(OS_E_APPERR1);`.
59+
* @note String must be null-terminated, maximum of 12 characters.
60+
*/
61+
#define os_AppErr1 ((char*)0xD025A9)
5862

59-
/*
60-
* --- TIOS System error codes ---
63+
/**
64+
* String for custom error.
65+
* Can be used by calling `os_ThrowError(OS_E_APPERR2);`.
66+
* @note String must be null-terminated, maximum of 12 characters.
6167
*/
68+
#define os_AppErr2 ((char*)0xD025B6)
69+
6270
#define OS_E_EDIT (1<<7)
6371
#define OS_E_MASK (0x7F)
6472
#define OS_E_OVERFLOW (1+OS_E_EDIT)

src/ce/include/ti/getcsc.h

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
extern "C" {
1717
#endif
1818

19-
#define os_KbdScanCode (*(uint8_t*)0xD00587) /**< Cached GetCSC code. Type: `sk_key_t` */
19+
/** `uint8_t`: Cached GetCSC code. */
20+
#define os_KbdScanCode (*(uint8_t*)0xD00587)
21+
/* @cond */
2022
#define os_KbdLGSC (*(uint8_t*)0xD00588)
2123
#define os_KbdPSC (*(uint8_t*)0xD00589)
2224
#define os_KbdWUR (*(uint8_t*)0xD0058A)
2325
#define os_KbdDebncCnt (*(uint8_t*)0xD0058B)
26+
/* @endcond */
2427

2528
/**
2629
* Checks if the [on] key was pressed
@@ -29,11 +32,6 @@ extern "C" {
2932
*/
3033
bool boot_CheckOnPressed(void);
3134

32-
/**
33-
* @brief Scan code type
34-
*/
35-
typedef uint8_t sk_key_t;
36-
3735
/**
3836
* Performs an OS call to get the keypad scan code
3937
*
@@ -52,35 +50,38 @@ typedef uint8_t sk_key_t;
5250
* Feel free to modify the string to suit your needs.
5351
* @returns Key scan code
5452
*/
55-
sk_key_t os_GetCSC(void);
53+
uint8_t os_GetCSC(void);
5654

57-
/*
58-
* --- TI-OS os_GetCSC Scan Code Return Values ---
59-
*/
6055
#define sk_Down 0x01
6156
#define sk_Left 0x02
6257
#define sk_Right 0x03
6358
#define sk_Up 0x04
6459
#define sk_Enter 0x09
6560
#define sk_2nd 0x36
66-
#define sk_Clear 0x0F /**< TI-84 Plus CE name. */
61+
/** TI-84 Plus CE name */
62+
#define sk_Clear 0x0F
6763
#define sk_Alpha 0x30
6864
#define sk_Add 0x0A
69-
#define sk_Sub 0x0B /**< Subtract, not negate */
65+
/** Subtract, not negate */
66+
#define sk_Sub 0x0B
7067
#define sk_Mul 0x0C
7168
#define sk_Div 0x0D
7269
#define sk_Graph 0x31
7370
#define sk_Trace 0x32
7471
#define sk_Zoom 0x33
75-
#define sk_Window 0x34 /**< TI-84 Plus CE name. */
76-
#define sk_Yequ 0x35 /**< TI-84 Plus CE name. */
72+
/** TI-84 Plus CE name */
73+
#define sk_Window 0x34
74+
/** TI-84 Plus CE name */
75+
#define sk_Yequ 0x35
7776
#define sk_Mode 0x37
78-
#define sk_Del 0x38 /**< TI-84 Plus CE name. */
77+
/** TI-84 Plus CE name */
78+
#define sk_Del 0x38
7979
#define sk_Store 0x2A
8080
#define sk_Ln 0x2B
8181
#define sk_Log 0x2C
8282
#define sk_Square 0x2D
83-
#define sk_Recip 0x2E /**< TI-84 Plus CE [x^-1]; on the TI-83 Premium CE, this is [<>] */
83+
/** TI-84 Plus CE [x^-1]; on the TI-83 Premium CE, this is [<>] */
84+
#define sk_Recip 0x2E
8485
#define sk_Math 0x2F
8586
#define sk_0 0x21
8687
#define sk_1 0x22
@@ -93,30 +94,51 @@ sk_key_t os_GetCSC(void);
9394
#define sk_6 0x13
9495
#define sk_9 0x14
9596
#define sk_Comma 0x25
96-
#define sk_Sin 0x26 /**< TI-84 Plus CE; on the TI-83 Premium CE, this is [TRIG] */
97-
#define sk_Apps 0x27 /**< TI-84 Plus CE; on the TI-83 Premium CE, this is [MATRICE] */
98-
#define sk_GraphVar 0x28 /**< X, T, theta, n */
97+
/** TI-84 Plus CE; on the TI-83 Premium CE, this is [TRIG] */
98+
#define sk_Sin 0x26
99+
/** TI-84 Plus CE; on the TI-83 Premium CE, this is [MATRICE] */
100+
#define sk_Apps 0x27
101+
/** X, T, theta, n */
102+
#define sk_GraphVar 0x28
99103
#define sk_DecPnt 0x19
100104
#define sk_LParen 0x1D
101-
#define sk_Cos 0x1E /**< TI-84 Plus CE; on the TI-83 Premium CE, this is [RESOL]. */
105+
/** TI-84 Plus CE; on the TI-83 Premium CE, this is [RESOL] */
106+
#define sk_Cos 0x1E
102107
#define sk_Prgm 0x1F
103108
#define sk_Stat 0x20
104-
#define sk_Chs 0x11 /**< Unary negation, not subtraction */
109+
/** Unary negation, not subtraction */
110+
#define sk_Chs 0x11
105111
#define sk_RParen 0x15
106-
#define sk_Tan 0x16 /**< TI-84 Plus CE; on; the TI-83 Premium CE, this is the fraction template. */
112+
/** TI-84 Plus CE; on; the TI-83 Premium CE, this is the fraction template */
113+
#define sk_Tan 0x16
107114
#define sk_Vars 0x17
108-
#define sk_Power 0x0E /**< [^] */
115+
/** [^] */
116+
#define sk_Power 0x0E
109117

110118
/* For the TI-83 Premium CE */
111-
#define sk_Fenetre sk_Window /**< TI-83 Premium CE name. */
112-
#define sk_Fx sk_Yequ /**< TI-83 Premium CE name. */
113-
#define sk_Suppr sk_Del /**< TI-83 Premium CE name. */
114-
#define sk_TglExact sk_Recip /**< TI-83 Premium CE [<>]; it's [x^-1] on the TI-84 Plus CE. */
115-
#define sk_Trig sk_Sin /**< TI-83 Premium CE; on the TI-84 Plus CE, this is [SIN] */
116-
#define sk_Matrice sk_Apps /**< TI-83 Premium CE; on the TI-84 Plus CE, this is [APPS] */
117-
#define sk_Resol sk_Cos /**< TI-83 Premium CE; on the TI-84 Plus CE, this is [COS] */
118-
#define sk_Frac sk_Tan /**< TI-83 Premium CE; on the TI-84 Plus CE, this is [TAN] */
119-
#define sk_Annul sk_Clear /**< TI-83 Premium CE name. */
119+
/** TI-83 Premium CE name */
120+
#define sk_Fenetre sk_Window
121+
/** TI-83 Premium CE name */
122+
#define sk_Fx sk_Yequ
123+
/** TI-83 Premium CE name */
124+
#define sk_Suppr sk_Del
125+
/** TI-83 Premium CE [<>]; it's [x^-1] on the TI-84 Plus CE */
126+
#define sk_TglExact sk_Recip
127+
/** TI-83 Premium CE; on the TI-84 Plus CE, this is [SIN] */
128+
#define sk_Trig sk_Sin
129+
/** TI-83 Premium CE; on the TI-84 Plus CE, this is [APPS] */
130+
#define sk_Matrice sk_Apps
131+
/** TI-83 Premium CE; on the TI-84 Plus CE, this is [COS] */
132+
#define sk_Resol sk_Cos
133+
/** TI-83 Premium CE; on the TI-84 Plus CE, this is [TAN] */
134+
#define sk_Frac sk_Tan
135+
/** TI-83 Premium CE name */
136+
#define sk_Annul sk_Clear
137+
138+
/* compatibility defines */
139+
/* @cond */
140+
typedef uint8_t sk_key_t;
141+
/* @endcond */
120142

121143
#ifdef __cplusplus
122144
}

src/ce/include/ti/real.h

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ typedef struct { int8_t sign, exp; uint8_t mant[7]; } real_t;
2828
*/
2929
typedef struct { real_t real, imag; } cplx_t;
3030

31-
#define os_OP1 ((uint8_t*)0xD005F8) /**< OP1 Variable */
32-
#define os_OP2 ((uint8_t*)0xD00603) /**< OP2 Variable */
33-
#define os_OP3 ((uint8_t*)0xD0060E) /**< OP3 Variable */
34-
#define os_OP4 ((uint8_t*)0xD00619) /**< OP4 Variable */
35-
#define os_OP5 ((uint8_t*)0xD00624) /**< OP5 Variable */
36-
#define os_OP6 ((uint8_t*)0xD0062F) /**< OP6 Variable */
37-
#define os_OP7 ((uint8_t*)0xD0063A) /**< OP7 Variable */
31+
/** OP1 Variable */
32+
#define os_OP1 ((uint8_t*)0xD005F8)
33+
/** OP2 Variable */
34+
#define os_OP2 ((uint8_t*)0xD00603)
35+
/** OP3 Variable */
36+
#define os_OP3 ((uint8_t*)0xD0060E)
37+
/** OP4 Variable */
38+
#define os_OP4 ((uint8_t*)0xD00619)
39+
/** OP5 Variable */
40+
#define os_OP5 ((uint8_t*)0xD00624)
41+
/** OP6 Variable */
42+
#define os_OP6 ((uint8_t*)0xD0062F)
43+
/** OP7 Variable */
44+
#define os_OP7 ((uint8_t*)0xD0063A)
3845

3946
/**
4047
* Contains data used by the statistics package.
@@ -50,11 +57,13 @@ typedef struct { real_t real, imag; } cplx_t;
5057
*/
5158
#define os_StatVars ((uint8_t*)0xD01191)
5259

53-
/**
60+
/** @defgroup finance_reals Finance Reals
5461
* The following are finance variables that are always allocated.
55-
*
5662
* They are all `real_t`.
5763
*/
64+
/** \addtogroup finance_reals
65+
* @{
66+
*/
5867
#define os_Fin_N (*(real_t*)0xD01F38)
5968
#define os_Fin_I (*(real_t*)0xD01F41)
6069
#define os_Fin_PV (*(real_t*)0xD01F4A)
@@ -68,6 +77,7 @@ typedef struct { real_t real, imag; } cplx_t;
6877
#define os_Cal_PMT (*(real_t*)0xD01F92)
6978
#define os_Cal_FV (*(real_t*)0xD01F9B)
7079
#define os_Cal_PY (*(real_t*)0xD01FA4)
80+
/** @}*/
7181

7282
/**
7383
* Copies a real_t type

src/ce/include/ti/screen.h

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -270,30 +270,38 @@ void os_SetDrawBGColor(uint24_t color);
270270
*/
271271
uint24_t os_GetDrawBGColor(void);
272272

273-
#define os_TextFlags (*(uint8_t*)0xD00080)
274-
275-
#define os_TextShadow ((uint8_t*)0xD006C0) /**< Text buffer, 260 bytes. */
273+
/* @cond */
274+
#define os_CmdShadow ((uint8_t*)0xD0232D)
275+
#define os_TextShadow ((uint8_t*)0xD006C0)
276276
#define os_PromptRow (*(uint8_t*)0xD00800)
277277
#define os_PromptCol (*(uint8_t*)0xD00801)
278278
#define os_PromptIns (*(uint8_t*)0xD00802)
279279
#define os_PromptShift (*(uint8_t*)0xD00803)
280280
#define os_PromptRet (*(uint8_t*)0xD00804)
281281
#define os_PromptValid (*(uint8_t*)0xD00807)
282+
/* @endcond */
282283

284+
/** `uint8_t`: Font row position */
283285
#define os_CurRow (*(uint8_t*)0xD00595)
286+
/** `uint8_t`: Font column position */
284287
#define os_CurCol (*(uint8_t*)0xD00596)
285-
286-
#define os_CmdShadow ((uint8_t*)0xD0232D)
287-
288-
#define os_TextFGColor (*(uint16_t*)0xD02688) /**< Large font foreground color */
289-
#define os_TextBGColor (*(uint16_t*)0xD0268A) /**< Large font background color */
290-
291-
#define os_PenCol (*(uint24_t*)0xD008D2) /**< Small font column location. */
292-
#define os_PenRow (*(uint8_t*)0xD008D5) /**< Small font row location. */
293-
#define os_DrawBGColor (*(uint16_t*)0xD026AA) /**< Small font background color */
294-
#define os_DrawFGColor (*(uint16_t*)0xD026AC) /**< Small font foreground color */
288+
/** `uint16_t`: Large font foreground 565 BGR color */
289+
#define os_TextFGColor (*(uint16_t*)0xD02688)
290+
/** `uint16_t`: Large font background 565 BGR color */
291+
#define os_TextBGColor (*(uint16_t*)0xD0268A)
292+
/** `uint24_t`: Small font column position */
293+
#define os_PenCol (*(uint24_t*)0xD008D2)
294+
/** `uint8_t`: Small font row position */
295+
#define os_PenRow (*(uint8_t*)0xD008D5)
296+
/** `uint16_t`: Small font background 565 BGR color */
297+
#define os_DrawBGColor (*(uint16_t*)0xD026AA)
298+
/** `uint16_t`: Small font foreground 565 BGR color */
299+
#define os_DrawFGColor (*(uint16_t*)0xD026AC)
300+
/** `uint8_t`: Small OS font color code */
295301
#define os_DrawColorCode (*(uint8_t*)0xD026AE)
296-
#define os_GraphBGColor (*(uint16_t*)0xD02A98) /**< Graph background 565 color */
302+
/** `uint16_t`: Graph background 565 BGR color */
303+
#define os_GraphBGColor (*(uint16_t*)0xD02A98)
304+
/** `uint16_t`: OS Rect draw 565 BGR color */
297305
#define os_FillRectColor (*(uint16_t*)0xD02AC0)
298306

299307
#undef tiflags

src/ce/include/ti/ui.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ typedef enum {
7878
OS_COLOR_DARKGRAY
7979
} os_colors_t;
8080

81-
#define os_Brightness (*(uint8_t*)0xD0058F) /**< `uint8_t`: User's configured screen brightness */
82-
#define os_StatusBarBGColor (*(uint16_t*)0xD02ACC) /**< `uint16_t`: Status bar 565 color */
81+
/** `uint8_t`: User's configured screen brightness */
82+
#define os_Brightness (*(uint8_t*)0xD0058F)
83+
/** `uint16_t`: Status bar 565 color */
84+
#define os_StatusBarBGColor (*(uint16_t*)0xD02ACC)
8385

8486
#undef tiflags
8587

src/ce/include/ti/vars.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ extern "C" {
3333
/** Generally unused by the OS. Type: `uint8_t[256]` */
3434
#define os_AppData ((uint8_t*)0xD00429)
3535

36+
/* @cond */
3637
#define os_ProgToEdit ((char*)0xD0065B)
3738
#define os_NameBuff ((char*)0xD00663)
39+
/* @endcond */
3840

3941
/** Current size of executing program. Type: `uint16_t` */
4042
#define os_AsmPrgmSize (*(uint16_t*)0xD0118C)

0 commit comments

Comments
 (0)