add pic_boot function
This commit is contained in:
parent
c27ce690a6
commit
85b58bd43e
|
@ -695,7 +695,10 @@ foreach (@data) {
|
||||||
print "\n#endif\n\n";
|
print "\n#endif\n\n";
|
||||||
|
|
||||||
print <<EOL;
|
print <<EOL;
|
||||||
const char pic_boot[][80] = {
|
#include "picrin.h"
|
||||||
|
#include "picrin/extra.h"
|
||||||
|
|
||||||
|
static const char boot_rom[][80] = {
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
my @lines = $src =~ /.{0,80}/gs;
|
my @lines = $src =~ /.{0,80}/gs;
|
||||||
|
@ -715,6 +718,12 @@ print "\"\"\n";
|
||||||
print <<EOL;
|
print <<EOL;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
pic_boot(pic_state *pic)
|
||||||
|
{
|
||||||
|
pic_load_cstr(pic, &boot_rom[0][0]);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: scheme
|
mode: scheme
|
||||||
|
@ -730,7 +739,10 @@ EOL
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char pic_boot[][80] = {
|
#include "picrin.h"
|
||||||
|
#include "picrin/extra.h"
|
||||||
|
|
||||||
|
static const char boot_rom[][80] = {
|
||||||
"\n(builtin:define-macro call-with-current-environment\n (builtin:lambda (form env",
|
"\n(builtin:define-macro call-with-current-environment\n (builtin:lambda (form env",
|
||||||
")\n (list (cadr form) env)))\n\n(builtin:define here\n (call-with-current-enviro",
|
")\n (list (cadr form) env)))\n\n(builtin:define here\n (call-with-current-enviro",
|
||||||
"nment\n (builtin:lambda (env)\n env)))\n\n(builtin:define the ",
|
"nment\n (builtin:lambda (env)\n env)))\n\n(builtin:define the ",
|
||||||
|
@ -1033,6 +1045,12 @@ const char pic_boot[][80] = {
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
pic_boot(pic_state *pic)
|
||||||
|
{
|
||||||
|
pic_load_cstr(pic, &boot_rom[0][0]);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
Local Variables:
|
Local Variables:
|
||||||
mode: scheme
|
mode: scheme
|
||||||
|
|
|
@ -109,20 +109,18 @@ void pic_init_eval(pic_state *);
|
||||||
void pic_init_lib(pic_state *);
|
void pic_init_lib(pic_state *);
|
||||||
void pic_init_weak(pic_state *);
|
void pic_init_weak(pic_state *);
|
||||||
|
|
||||||
extern const char pic_boot[][80];
|
void pic_boot(pic_state *);
|
||||||
|
|
||||||
|
#define DONE pic_leave(pic, ai);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pic_init_core(pic_state *pic)
|
pic_init_core(pic_state *pic)
|
||||||
{
|
{
|
||||||
size_t ai;
|
size_t ai = pic_enter(pic);
|
||||||
pic_value env;
|
pic_value env;
|
||||||
|
|
||||||
pic_deflibrary(pic, "picrin.base");
|
pic_deflibrary(pic, "picrin.base");
|
||||||
|
|
||||||
ai = pic_enter(pic);
|
|
||||||
|
|
||||||
#define DONE pic_leave(pic, ai);
|
|
||||||
|
|
||||||
env = pic_library_environment(pic, pic->lib);
|
env = pic_library_environment(pic, pic->lib);
|
||||||
|
|
||||||
import_builtin_syntax("define");
|
import_builtin_syntax("define");
|
||||||
|
@ -133,8 +131,7 @@ pic_init_core(pic_state *pic)
|
||||||
import_builtin_syntax("begin");
|
import_builtin_syntax("begin");
|
||||||
import_builtin_syntax("define-macro");
|
import_builtin_syntax("define-macro");
|
||||||
|
|
||||||
DONE;
|
pic_init_features(pic); DONE;
|
||||||
|
|
||||||
pic_init_bool(pic); DONE;
|
pic_init_bool(pic); DONE;
|
||||||
pic_init_pair(pic); DONE;
|
pic_init_pair(pic); DONE;
|
||||||
pic_init_port(pic); DONE;
|
pic_init_port(pic); DONE;
|
||||||
|
@ -159,9 +156,7 @@ pic_init_core(pic_state *pic)
|
||||||
pic_init_write(pic); DONE;
|
pic_init_write(pic); DONE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pic_init_features(pic);
|
pic_boot(pic); DONE;
|
||||||
|
|
||||||
pic_load_cstr(pic, &pic_boot[0][0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pic_state *
|
pic_state *
|
||||||
|
|
Loading…
Reference in New Issue