retroforth/tools/generate-devices.retro
crc fffe7170a2 begin using new DEVICE: namespace for device id constants
FossilOrigin-Name: 899ef8eab4ff7e1ca87a340a3409cbdc09505f063aa863c19e350e3b01ac40cd
2023-12-09 18:49:47 +00:00

11 lines
268 B
Forth

~~~
'~~~ s:put nl
:process (s-)
dup s:length n:zero? [ drop ] if;
#32 s:tokenize dup #1 a:fetch [ dup $_ eq? [ drop $: ] if ] s:map
swap a:last s:to-number
'#%n_'%s_const\n s:format s:put ;
'vm/nga-c/devices.h [ process ] file:for-each-line
'~~~ s:put nl
~~~