From 0a8b1c5a403b18671563dd47851f6b8d0b32a79f Mon Sep 17 00:00:00 2001 From: mgcaret Date: Sun, 3 May 2020 14:51:42 -0700 Subject: [PATCH] GoSXB: more romfs stuff --- .gitignore | 2 +- platforms/GoSXB/build.sh | 2 +- platforms/GoSXB/mkromfs.rb | 6 +++++- platforms/GoSXB/romfs_files/AUTOEXEC | 7 +++++++ platforms/GoSXB/romfs_files/message.fs | 26 ++++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 platforms/GoSXB/romfs_files/AUTOEXEC create mode 100644 platforms/GoSXB/romfs_files/message.fs diff --git a/.gitignore b/.gitignore index 37ddec4..4efa076 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,6 @@ romfs of816-neon.bin platforms/GoSXB/rom platforms/GoSXB/romfs -platforms/GoSXB/romfs_files +platforms/GoSXB/romfs_files/OF cov.yml diff --git a/platforms/GoSXB/build.sh b/platforms/GoSXB/build.sh index 3859f60..6924e3e 100755 --- a/platforms/GoSXB/build.sh +++ b/platforms/GoSXB/build.sh @@ -6,7 +6,7 @@ if [ -r fcode/romfs.fs ]; then fi if [ -d romfs_files ]; then cd romfs_files - ../mkromfs.rb ../romfs * + ../mkromfs.rb ../romfs * */** cd .. fi ca65 -I ../../inc GoSXB.s -l GoSXB.lst diff --git a/platforms/GoSXB/mkromfs.rb b/platforms/GoSXB/mkromfs.rb index 557e8ac..673b816 100755 --- a/platforms/GoSXB/mkromfs.rb +++ b/platforms/GoSXB/mkromfs.rb @@ -44,7 +44,11 @@ abort("Too many files (>15)") if ARGV.count > 255 new_romfs ARGV.each do |name| - add_file_header(name, File.size(name)) + if File.file?(name) + add_file_header(name, File.size(name)) + else + puts "skipping #{name} - not a regular file" + end end @offset_map.each_pair do |name, offset| diff --git a/platforms/GoSXB/romfs_files/AUTOEXEC b/platforms/GoSXB/romfs_files/AUTOEXEC new file mode 100644 index 0000000..afa6f75 --- /dev/null +++ b/platforms/GoSXB/romfs_files/AUTOEXEC @@ -0,0 +1,7 @@ +also romfs +." ROMfs bootstrap by M.G." cr +s" message.fs" ?romfs-run +s" board.fs" ?romfs-run +s" OF/base.fs" ?romfs-run +previous + diff --git a/platforms/GoSXB/romfs_files/message.fs b/platforms/GoSXB/romfs_files/message.fs new file mode 100644 index 0000000..39e2315 --- /dev/null +++ b/platforms/GoSXB/romfs_files/message.fs @@ -0,0 +1,26 @@ +base @ decimal +: message ( n -- 0|n ) + dup case + -3 of s" Stack o/f" endof + -9 of s" Invalid address" endof + -11 of s" Numeric o/f" endof + -12 of s" Argument type m/m" endof + -14 of s" Compile-only word" endof + -18 of s" String o/f" endof + -21 of s" Unsupported operation" endof + -22 of s" Control structure m/m" endof + -24 of s" Invalid numeric arg" endof + -31 of s" Can't >BODY" endof + -37 of s" I/O error" endof + -38 of s" File not found" endof + -49 of s" Search-order o/f" endof + -50 of s" Search-order u/f" endof + -59 of s" Can't ALLOC-MEM" endof + -60 of s" Can't FREE-MEM" endof + -69 of s" Can't open file" endof + -256 of s" Undefined Fcode#" endof + >r 0 0 r> + endcase + ?dup if type drop 0 else drop then +; +base !