Skip to content

Commit 9b73e77

Browse files
improve fileioc documentation a little bit
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent 069bf9d commit 9b73e77

File tree

11 files changed

+244
-237
lines changed

11 files changed

+244
-237
lines changed

docs/_static/css/tables.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.wy-table-responsive table td {
2+
white-space: normal !important;
3+
}
4+
.wy-table-responsive {
5+
overflow: visible !important;
6+
}

docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,11 @@
5959
breathe_default_project = 'CE C/C++ Toolchain'
6060
subprocess.call('doxygen doxyfile', shell=True)
6161
breathe_projects['CE C/C++ Toolchain'] = 'doxygen/xml'
62+
63+
def check_conditional_assets(app, pagename, templatename, context, doctree):
64+
if pagename != 'libraries/fileioc':
65+
context["css_files"] = ['']
66+
67+
def setup(app):
68+
app.connect('html-page-context', check_conditional_assets)
69+
app.add_css_file('css/tables.css')

docs/doxyfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,6 @@ INPUT = ../src/graphx/graphx.h \
853853
../src/ce/include/ti/getcsc.h \
854854
../src/ce/include/ti/getkey.h \
855855
../src/ce/include/ti/screen.h \
856-
../src/ce/include/ti/hooks.h \
857856
../src/ce/include/ti/info.h \
858857
../src/ce/include/ti/python.h \
859858
../src/ce/include/ti/real.h \

docs/libraries/fileioc.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ fileioc.h
77
88
#include <fileioc.h>
99
10-
The fileioc library is used for writing and reading program data to files.
11-
File support is implemented with the use of AppVars.
12-
Additionally, the library supports accessing program data and various OS variable manipulation.
10+
The :code:`fileioc` library provides access to OS variables such as AppVars, Programs, Lists, and Strings.
11+
12+
AppVars are special types of variables that can be used to store any arbitrary data, and are utilized by the CE toolchain to provide data storage beyond what can be compiled into a program.
13+
AppVars may store things like save states, sprites, and user configurations.
14+
15+
The OS stores variables in either RAM or archive (aka flash) memory.
16+
RAM memory is volatile and is cleared whenever the calculator is reset, whereas archive memory provides a more permanent storage for variables.
17+
However, variables can only be written to while in RAM as the calculator's security measures do not provide a way to directly write to the archive.
18+
The function :code:`ti_SetArchiveStatus` can be used to move a variable between the archive and RAM.
1319

1420
.. contents:: :local:
1521
:depth: 3

docs/libraries/fontlibc.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ fontlibc.h
77
88
#include <fontlibc.h>
99
10-
fontlibc was designed under a "mechanism not policy" sort of philosophy.
10+
The :code:`fontlibc` library provides routines for displaying custom fonts and glyphs, and can be used to extend the limited font capabilities of :ref:`graphx <graphx_h>`.
11+
12+
The :code:`fontlibc` library was designed under a "mechanism not policy" sort of philosophy.
1113
Rather than attempting to provide as many fancy features as a programmer could want, fontlibc tries to provide fast, basic routines that can be used to build the additional functionality you want.
1214
For example, word-wrap is not directly provided, but can be implemented using :code:`fontlib_SetAlternateStopCode` and :code:`fontlib_GetStringWidth`.
13-
fontlib hopes to provide enough performance to be usable in games, while providing powerful enough basic features for fancy GUIs and document editors.
15+
fontlibc hopes to provide enough performance to be usable in games, while providing powerful enough basic features for fancy GUIs and document editors.
1416

1517
.. contents:: :local:
1618
:depth: 3
1719

1820
Creating Fonts
1921
--------------
2022

21-
Fonts for use with FontLibC can be made with any program that can produce Windows 3.x .FNT resource files.
23+
Fonts for use with fontlibc can be made with any program that can produce Windows 3.x .FNT resource files.
2224

2325
Editor Software
2426
~~~~~~~~~~~~~~~

docs/libraries/graphx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ graphx.h
77
88
#include <graphx.h>
99
10-
The graphx library implements efficient graphics routines from everything to drawing sprites, shapes, and tilemaps.
10+
The :code:`graphx` library implements efficient graphics routines from everything to drawing sprites, shapes, and tilemaps.
1111
This allows a programmer to easily add quality graphics to their program without needing to worry about the low-level implementation details.
1212

1313
.. contents:: :local:

docs/libraries/keypadc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keypadc.h
77
88
#include <keypadc.h>
99
10-
The keypadc library is used for quickly polling the status of the keys in the keypad.
10+
The :code:`keypadc` library is used for quickly polling the status of the keys in the keypad.
1111
It supports multi-key presses, and can be used for extremely responsive input compared to OS routines such as :code:`os_GetCSC()`.
1212

1313
.. contents:: :local:

docs/static/faq.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,19 @@ Linking Assembly Source Files
5959
Assembly routines can be linked into a C/C++ program provided the following conditions are met:
6060

6161
- The file's extension is **.asm**. It can be placed at any depth in the sources directory.
62-
- The routine should have a C/C++ prototype if it used externally.
62+
- The appropriate section is declared - either :code:`.text` for code, :code:`.data` for initialized data, or :code:`.rodata` for read-only data.
63+
This is done using the `section` keyword, whereby everything after the keyword will be added to the defined section.
6364
- The assembly routine must be prefixed with an underscore, and have a corresponding `public` entry in the assembly file.
6465
- Any external functions called from the assembly source must be listed as being `extern`.
66+
- A separate header file should define a C/C++ prototype for the function if it is called from C/C++ code.
6567

66-
Below is an example assembly source file that relies on an external function:
68+
Below is an example C prototype followed by the assembly implementation:
6769

68-
.. code-block:: asm
70+
.. code-block:: c
71+
72+
void asm_func(int arg);
73+
74+
.. code-block::
6975
7076
assume adl=1
7177
@@ -75,21 +81,13 @@ Below is an example assembly source file that relies on an external function:
7581
_asm_func:
7682
pop hl
7783
pop de
78-
push de
84+
push de ; de = arg
7985
push hl
8086
call _external_func
8187
ret
8288
8389
extern _external_func
8490
85-
The C prototype is shown below:
86-
87-
C File:
88-
89-
.. code-block:: c
90-
91-
void asm_func(int a);
92-
9391
Arguments
9492
~~~~~~~~~
9593

docs/static/getting-started.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Getting Started
66
Installing the CE Toolchain
77
---------------------------
88

9-
* Download the latest stable toolchain release for your OS `here <https://github.com/CE-Programming/toolchain/releases/latest>`_.
9+
* Download the latest stable toolchain release for your OS `here <https://github.com/CE-Programming/toolchain/releases/latest>`__.
1010

11-
* You can optionally try the "nightly" build `here <https://github.com/CE-Programming/toolchain/releases/tag/nightly>`_ instead - this is where all current development happens, and provides the latest features and support before an official release.
12-
13-
* Extract the archive to a location **without any spaces in it**.
11+
* You can optionally try the "nightly" build `here <https://github.com/CE-Programming/toolchain/releases/tag/nightly>`__ instead - this is where all current development happens, and provides the latest features and support before an official release.
1412

1513
**On Windows**
1614

15+
* Extract the archive to a location **without any spaces in it**, e.g. :code:`C:\CEdev`.
16+
1717
* Double click :code:`cedev.bat` inside the extracted :code:`CEdev` folder to launch the toolchain environment.
1818
You may have to allow the script to be run depending on the user account control.
1919

@@ -22,6 +22,8 @@ Installing the CE Toolchain
2222

2323
**On Linux or macOS**
2424

25+
* Extract the archive to a location **without any spaces in it**, e.g. :code:`/home/user/CEdev`.
26+
2527
* Extend the PATH environment variable to point to :code:`CEdev/bin` by modifying `.bashrc`, `.zshrc`, or whatever flavor your OS uses.
2628

2729
.. indent with spaces

docs/static/hardware.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ Archived variables, the operating system, and applications, are all stored in fl
168168
While you can freely read any and all of flash, the calculator's hardware prevents you from writing to flash, and in fact, attempting to do so will cause a crash.
169169
The calculator's operating system works with special hardware to enforce this restriction in order to prevent students from patching the OS to let them cheat.
170170
Consequently, the only way to store data in flash is to create a variable in RAM and then archive it.
171-
The :code:`fileioc` library makes this easy.
171+
The :ref:`fileioc library <fileioc_h>` makes this easy.
172172

173-
Because teachers (and therefore TI's management) get very worked up by cheating, the toolchain does not and will not provide any means of bypassing this restriction.
173+
Because teachers (and therefore TI's management) get very worked up by cheating, the toolchain does not (and will not) provide any means of bypassing this restriction.
174174

175175
The LCD
176176
^^^^^^^

0 commit comments

Comments
 (0)