From 68b5c8de5dd6bf4c0e7d8d4bb83b1eb4711c350b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 27 Jan 2008 18:11:42 +0000 Subject: [PATCH] * Accept 16 as fpu cookie, CT060 seems to use it. * map haiku console colors to atari's palette. * move the stack up for testing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23769 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../boot/platform/atari_m68k/atari_memory_map.h | 3 ++- src/system/boot/platform/atari_m68k/console.cpp | 16 +++++++++++----- src/system/boot/platform/atari_m68k/cpu.cpp | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/system/boot/platform/atari_m68k/atari_memory_map.h b/src/system/boot/platform/atari_m68k/atari_memory_map.h index f9c4260e3f..36f7e64960 100644 --- a/src/system/boot/platform/atari_m68k/atari_memory_map.h +++ b/src/system/boot/platform/atari_m68k/atari_memory_map.h @@ -21,7 +21,8 @@ #define ATARI_SHADOW_BASE 0xff000000 /* how we will use it */ -#define ATARI_ZBEOS_STACK_BASE 0x00040000 +//#define ATARI_ZBEOS_STACK_BASE 0x00040000 +#define ATARI_ZBEOS_STACK_BASE 0x00060000 #define ATARI_ZBEOS_BASE 0x00080000 /* from .prg shell.S will copy itself there */ #endif /* ATARI_MEMORY_MAP_H */ diff --git a/src/system/boot/platform/atari_m68k/console.cpp b/src/system/boot/platform/atari_m68k/console.cpp index 94d664e07f..fc8bcf0689 100644 --- a/src/system/boot/platform/atari_m68k/console.cpp +++ b/src/system/boot/platform/atari_m68k/console.cpp @@ -235,9 +235,15 @@ translate_color(int32 color) e: ff ff 55 // yellow f: ff ff ff // white */ - if (color >= 0 && color < 16) - return color; - return 0; + // cf. http://www.fortunecity.com/skyscraper/apple/308/html/chap4.htm + static const char cmap[] = { + 15, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 0 }; + + if (color < 0 && color >= 16) + return 0; + return cmap[color]; + //return color; } @@ -245,8 +251,8 @@ void console_set_color(int32 foreground, int32 background) { char buff[] = "\033b \033c "; - buff[2] = (char)translate_color(foreground); - buff[5] = (char)translate_color(background); + buff[2] += (char)translate_color(foreground); + buff[5] += (char)translate_color(background); sInput.WriteAt(NULL, 0LL, buff, 6); } diff --git a/src/system/boot/platform/atari_m68k/cpu.cpp b/src/system/boot/platform/atari_m68k/cpu.cpp index b667fd47f0..f907279364 100644 --- a/src/system/boot/platform/atari_m68k/cpu.cpp +++ b/src/system/boot/platform/atari_m68k/cpu.cpp @@ -65,7 +65,8 @@ check_cpu_features() fpu_emul = (uint16)(c->ivalue); #warning M68K: check for fpu in detail - if (fpu_type < 2 || fpu_type > 9) { + // CT060 seems to use 16... + if (fpu_type < 2 || fpu_type > 16) { panic("bad fpu"); return EINVAL; }