ri: now embeds the image

FossilOrigin-Name: c8abac0f0e055525797cb12f0870aa99e06f088c523b6ebb7eef4b0947bb4018
This commit is contained in:
crc 2018-01-15 13:29:28 +00:00
parent ca6ff280d1
commit 59d820d6e9
4 changed files with 23 additions and 1 deletions

View file

@ -24,6 +24,7 @@ Interfaces:
- Build script no longer links this against libm
- pascal/listener is a Free Pascal implementation by Rob Judd
- ri is a new (n)curses based interface
Other:

View file

@ -27,6 +27,12 @@ cd ..
./bin/muri literate/Rx.md
./bin/extend literate/RetroForth.md
cp ngaImage interfaces/ri
cd interfaces/ri
../../bin/embedimage >image.c
rm ngaImage
cd ../..
cp ngaImage interfaces
cd interfaces
../bin/extend rre_windows.forth

3
interfaces/ri/image.c Normal file

File diff suppressed because one or more lines are too long

View file

@ -78,6 +78,14 @@ CELL memory[IMAGE_SIZE + 1]; /* The memory for the image */
#define TORS address[rp] /* Shortcut for top item on address stack */
/*---------------------------------------------------------------------
`ri` embeds the image into the binary. This includes the image data
(converted to a .c file by an external tool).
---------------------------------------------------------------------*/
#include "image.c"
/*---------------------------------------------------------------------
Moving forward, a few variables. These are updated to point to the
latest values in the image.
@ -420,7 +428,11 @@ int main() {
int n = 0; /* Index to input buffer */
ngaPrepare();
ngaLoadImage("ngaImage");
for (n = 0; n < ngaImageCells; n++) /* Copy the embedded image to */
memory[n] = ngaImage[n]; /* the Nga VM memory */
n = 0;
update_rx();
setup_interface();