Commit 9e98e7ae authored by Erick's avatar Erick

Use read-byte instead of read-char when making the C boot file.

parent a24a87e8
;;;;
;;;; make-C-boot.stk -- Create a C image to boot on
;;;;
;;;; Copyright © 2005-2006 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;;
;;;; Copyright © 2005-2011 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 29-Mar-2005 14:58 (eg)
;;;; Last file update: 5-Dec-2006 18:50 (eg)
;;;; Last file update: 27-Jul-2011 19:26 (eg)
;;;;
;; ----------------------------------------------------------------------
......@@ -51,15 +51,13 @@ This is a dump of the image in file ~A
(format out "char* STk_boot_consts = ~S;\n\n" (get-output-string str)))
(let ((sz (read in)))
(format out "STk_instr STk_boot_code [] = { \n")
(read-char in) ; To skip the newline after size
(read-byte in) ; To skip the newline after size
(dotimes (i sz)
(let* ((c1 (read-char in))
(c2 (read-char in)))
(let* ((c1 (read-byte in))
(c2 (read-byte in)))
(format out
"0x~A"
(number->string (bit-or (bit-shift (char->integer c1) 8)
(char->integer c2))
16))
(number->string (bit-or (bit-shift c1 8) c2) 16))
(when (< i (- sz 1))
(display ",\n" out))))
(display "};\n" out))
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment