2019-06-05 16:18:17 +02:00
|
|
|
# Amalgamate
|
|
|
|
|
|
|
|
The standard RETRO system is built using the Nga VM[1] and a
|
|
|
|
copy of the image exported as a C source file[2]. I sometimes
|
|
|
|
prefer to have these as a single file for easier sharing. This
|
|
|
|
is a quick little tool to combine them.
|
|
|
|
|
|
|
|
Output will be written to stdout.
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
2019-12-13 17:58:48 +01:00
|
|
|
[1] vm/nga-c/retro-unix.c
|
|
|
|
[2] vm/nga-c/retro-image.c
|
2019-06-05 16:18:17 +02:00
|
|
|
|
|
|
|
## Code
|
2019-05-20 22:28:55 +02:00
|
|
|
|
|
|
|
~~~
|
2019-06-05 16:18:17 +02:00
|
|
|
{{
|
|
|
|
:image:inline
|
2019-12-13 17:58:48 +01:00
|
|
|
'vm/nga-c/retro-image.c [ s:put nl ] file:for-each-line ;
|
2019-06-05 16:18:17 +02:00
|
|
|
|
|
|
|
:source:line
|
|
|
|
dup '#include_"retro-image.c" s:eq?
|
|
|
|
[ drop image:inline ] [ s:put nl ] choose ;
|
|
|
|
|
|
|
|
---reveal---
|
2019-05-20 22:28:55 +02:00
|
|
|
|
2019-06-05 16:18:17 +02:00
|
|
|
:amalgamate
|
2019-12-13 17:58:48 +01:00
|
|
|
'vm/nga-c/retro-unix.c [ source:line ] file:for-each-line ;
|
2019-06-05 16:18:17 +02:00
|
|
|
}}
|
2019-05-20 22:28:55 +02:00
|
|
|
|
2019-06-05 16:18:17 +02:00
|
|
|
amalgamate
|
2019-05-20 22:28:55 +02:00
|
|
|
~~~
|