*
* @APPLE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* sl_words.c - Forth and C code for the sl_words package.
*
- * Copyright (c) 1998-2000 Apple Computer, Inc.
+ * Copyright (c) 1998-2002 Apple Computer, Inc.
*
* DRI: Josh de Cesare
*/
CICell SLWordsIH = 0;
-long InitSLWords(long ofVers)
+long InitSLWords(void)
{
long result, cnt;
- result = Interpret_1_1
- (
- " drop"
-
+ result = Interpret(0, 1,
" hex"
" unselect-dev"
" ;"
// Set up the spin cursor stuff.
- " 0 value spinType"
" 0 value screenIH"
" 0 value cursorAddr"
" 0 value cursorX"
" 0 value cursorY"
" 0 value cursorW"
" 0 value cursorH"
+ " 0 value cursorFrames"
" 0 value cursorPixelSize"
" 0 value cursorStage"
" 0 value cursorTime"
" get-msecs dup cursorTime - cursorDelay >= if"
" to cursorTime"
" slw_update_keymap"
- " spinType 0= if"
- " cursorStage 1+ 3 mod dup to cursorStage"
- " cursorW * cursorH * cursorAddr +"
- " cursorX cursorY cursorW cursorH"
- " \" draw-rectangle\" screenIH $call-method"
- " else"
- " cursorStage 1+ 6 mod dup to cursorStage"
- " dup 3 > if 6 swap - then dup >r"
- " 1+ cursorW * cursorPixelSize * cursorAddr +"
- " cursorX cursorY cursorW cursorH r> 1+ -"
- " \" draw-rectangle\" screenIH $call-method"
- " then"
+ " cursorStage 1+ cursorFrames mod dup to cursorStage"
+ " cursorW cursorH * cursorPixelSize * * cursorAddr +"
+ " cursorX cursorY cursorW cursorH"
+ " \" draw-rectangle\" screenIH $call-method"
" else"
" drop"
" then"
" then"
" ;"
- // slw_spin_init ( screenIH cursorAddr cursorX cursorY cursorW cursorH --)
+ // slw_spin_init ( screenIH cursorAddr cursorX cursorY cursorW cursorH--)
" : slw_spin_init"
- " to cursorH to cursorW"
- " to cursorY to cursorX"
- " to cursorAddr to screenIH"
- " d# 111 to cursorDelay"
- " ['] slw_spin to spin"
- " ;"
-
- // slw_spin_init2 ( screenIH cursorAddr cursorX cursorY cursorW cursorH--)
- " : slw_spin_init2"
- " 1 to spinType"
- " to cursorH dup FFFF and to cursorW 10 >> to cursorPixelSize"
- " to cursorY to cursorX"
+ " dup FFFF and to cursorH 10 >> drop"
+ " dup FFFF and to cursorW 10 >> to cursorPixelSize"
+ " dup FFFF and to cursorY 10 >> d# 1000 swap / to cursorDelay"
+ " dup FFFF and to cursorX 10 >> to cursorFrames"
" to cursorAddr to screenIH"
- " d# 50 to cursorDelay"
" ['] slw_spin to spin"
" ;"
" 0 0 \" sl_words\" $open-package"
- , ofVers, &SLWordsIH);
+ , &SLWordsIH);
if (result != kCINoError) return result;
if (SLWordsIH == 0) return kCIError;
if (gOFVersion < kOFVersion3x) {
- result = Interpret_1_0
- (
+ result = Interpret(1, 0,
" dev /packages/obp-tftp"
" ['] load C + l!"
, kLoadSize);
}
if (gOFVersion < kOFVersion3x) {
- result = Interpret_1_0
- (
+ result = Interpret(1, 0,
" dev /packages/mac-parts"
" \" lame\" device-name"
" dev /packages"
if (gOFVersion < kOFVersion2x) {
for(cnt = 0; gControl2Source[cnt] != '\0'; cnt++) {
- result = Interpret_0_0(gControl2Source[cnt]);
+ result = Interpret(0, 0, gControl2Source[cnt]);
if (result == kCIError) return kCIError;
if (result == kCICatch) return kCINoError;
}
#if SL_DEBUG
void InitDebugWords(void)
{
- Interpret_0_0
- (
+ Interpret(0, 0,
// .sc ( -- )
" : .sc ?state-valid ci-regs 4+ l@ l@ dup 0= \" Bad Stack\" (abort\")"
" cr .\" Stack Trace\""
- " begin dup while dup 8 + l@ cr u. l@ repeat drop ;"
+ " begin dup while dup 8 + l@ cr u. l@ repeat drop ;"
);
}
#endif
void SetOutputLevel(long level)
{
- CallMethod_1_0(SLWordsIH, "slw_set_output_level", level);
+ CallMethod(1, 0, SLWordsIH, "slw_set_output_level", level);
}
long ret;
char *keyMap;
- ret = CallMethod_1_1(SLWordsIH, "slw_init_keymap",
- keyboardIH, (CICell *)&keyMap);
+ ret = CallMethod(1, 1, SLWordsIH, "slw_init_keymap",
+ keyboardIH, (CICell *)&keyMap);
if (ret != kCINoError) return NULL;
return keyMap;
void UpdateKeyMap(void)
{
- CallMethod_0_0(SLWordsIH, "slw_update_keymap");
+ CallMethod(0, 0, SLWordsIH, "slw_update_keymap");
}
-void SpinInit(long spinType, CICell screenIH, char *cursorAddr,
- long cursorX, long cursorY, long cursorW, long cursorH,
- long pixelSize)
+void SpinInit(CICell screenIH, char *cursorAddr,
+ long cursorX, long cursorY,
+ long cursorW, long cursorH,
+ long frames, long fps,
+ long pixelSize, long spare)
{
- if (spinType == 0) {
- CallMethod_6_0(SLWordsIH, "slw_spin_init",
- screenIH, (long)cursorAddr,
- cursorX, cursorY, cursorW, cursorH);
- } else {
- CallMethod_6_0(SLWordsIH, "slw_spin_init2",
- screenIH, (long)cursorAddr,
- cursorX, cursorY, cursorW | pixelSize << 16, cursorH);
- }
+ CallMethod(6, 0, SLWordsIH, "slw_spin_init",
+ screenIH, (long)cursorAddr,
+ cursorX | (frames << 16),
+ cursorY | (fps << 16),
+ cursorW | (pixelSize << 16),
+ cursorH | (spare << 16));
}
void Spin(void)
{
- CallMethod_0_0(SLWordsIH, "slw_spin");
+ CallMethod(0, 0, SLWordsIH, "slw_spin");
}
+
long GetPackageProperty(CICell phandle, char *propName,
char **propAddr, long *propLen)
{
long ret, nameLen = strlen(propName);
- ret = Interpret_3_2("get-package-property if 0 0 then",
- phandle, nameLen, (CICell)propName,
- (CICell *)propLen, (CICell *)propAddr);
+ ret = Interpret(3, 2, "get-package-property if 0 0 then",
+ (CICell)propName, nameLen, phandle,
+ (CICell *)propAddr, (CICell *)propLen);
if ((ret != kCINoError) || (*propAddr == NULL)) return -1;
return 0;