Commit 1fe019e6 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

32-bit work merged from kbracey_32bit branch.

Version 5.06. Tagged as 'RISC_OSLib-5_06'
parent 9914d2a6
To make ANSILib, RISCOSLib, stubs and Shared C library module compatible with
26-bit RISC OS 3.1 onwards (including APCS-32 client support in Shared C
Library), build with APCS = APCS-R, No26bitCode = {FALSE}, No32bitCode =
{TRUE}.
To make RISCOSLib, stubs compatible with 26 or 32-bit RISC OS 3.1 onwards,
build with APCS = APCS-32. The resulting programs will require an APCS-32 capable
Shared C Library.
To make ANSILib compatible with 26 or 32-bit RISC OS 3.5 onwards, build with
APCS = APCS-32, No26bitCode = {TRUE}, No32bitCode = {FALSE}.
To make Shared C Library compatible with 32-bit RISC OS, build with APCS = APCS-32.
An APCS-32 Shared C Library will NOT run 26-bit programs, even on a 26-bit
system; an APCS-R Shared C Library must be used. In a build using APCS-32,
the SCL must be forced to APCS-R - pass the option SCL_APCS="-APCS 3/26bit"
in the components file to acheive this.
26-bit Shared C library (ROM or RAM): ARM 2 or later (26-bit)
Will always be in 26-bit modes
Client may be APCS-32 or APCS-R
26-bit ANSILib ARM 2 or later (26-bit)
Will always be in 26-bit modes
Client is APCS-R
32-bit Shared C library (ROM or RAM): ARM 6 or later (32-bit)
May be in 26 or 32-bit modes
32-bit instructions always available
Client is APCS-32
32-bit ANSILib ARM 6 or later
May be in 26 or 32-bit modes
32-bit instructions always available
Client is APCS-32
32-bit ANSILib will be RISC OS 3.5 or later
other requirements for any CLib or ANSILib:
RISC OS 3.1
FPEmulator 4.03 or later
CallASWI (if RISC OS 3.6 or earlier)
......@@ -24,7 +24,6 @@
# lib.romstubs RISC_OSLib:o.romstubs ${ROMSTUBS} ROM RISC_OSStubs Module_Only
# lib.romastubs ROM RISC_OSStubs Apps_Only
# lib.ansilib
# lib.arthurlib
# lib.clib
# lib.riscoslibm
#---------------------------------------------------------------------------------------------
......@@ -75,6 +74,7 @@ INCLUDES =
STK_EXTN =
# RISCOS_Lib txt flags
DFLAGS =\
-DFIELDNUM\
-DBIG_WINDOWS\
......@@ -82,7 +82,7 @@ DFLAGS =\
-DALLOW_OLD_PATTERNS\
-DSET_MISC_OPTIONS
# ANSILib flags
# ANSILib and stub flags
CLFLAGS =\
-DDEFAULT_TEXT
......@@ -90,18 +90,20 @@ ALFLAGS =\
-PD "DEFAULT_TEXT SETL {TRUE}"
VLFLAGS =\
-DLIB_SHARED="\"\""\
-DLIB_APCS="\"R\""
-DLIB_SHARED="\"\""
# Shared C Library flags
CSFLAGS =\
-I@,^.clib\
-DSHARED_C_LIBRARY\
-DUROM
-DUROM\
${SCL_APCS}
VSFLAGS =\
-DLIB_SHARED="\"Shared \""\
-DLIB_APCS="\"R\""
-DLIB_SHARED="\"Shared \""
ASFLAGS =\
${SCL_APCS}
VPATH = @ kernel clib rlib
......@@ -109,16 +111,17 @@ VPATH = @ kernel clib rlib
#
# Rule patterns
#
# Note
.c.o:; ${CC} ${CFLAGS} -fah ${CLFLAGS} -o $@ $<
.c.o_rl:; ${CC} ${CFLAGS} ${DFLAGS} -o $@ $<
.c.m_o_rl:; ${CC} ${CFLAGS} -ffah ${DFLAGS} -zM -o $@ $<
.c.rm_o:; ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} -o $@ $<
.c.rm_o_rl:; ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${STK_EXTN} -o $@ $<
.c.rm_o:; ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${OPTIONS} -o $@ $<
.c.rm_o_rl:; ${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${OPTIONS} -o $@ $<
.s.o:; ${OBJASM} ${AFLAGS} ${ALFLAGS} $< $@
.s.o_rl:; ${OBJASM} ${AFLAGS} $< $@
.s.m_o_rl:; ${OBJASM} ${AFLAGS} $< $@
.s.rm_o:; ${OBJASM} ${AFLAGS} $< $@
.s.rm_o_rl:; ${OBJASM} ${AFLAGS} $< $@
.s.rm_o:; ${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} $< $@
.s.rm_o_rl:; ${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} $< $@
#
# Libraries
......@@ -485,10 +488,10 @@ lib.riscoslibm: ${RLIB_MOD_OBJS}
${LIBFILE} ${LIBFLAGS} $@ ${RLIB_MOD_OBJS}
lib.stubs: clib.s.cl_stub_r
${OBJASM} ${AFLAGS} -from clib.s.cl_stub_r -to $@
${OBJASM} ${ALFLAGS} -from clib.s.cl_stub_r -to $@
lib.rstubs: rlib.s.rl_stub_r
${OBJASM} ${AFLAGS} -from rlib.s.rl_stub_r -to $@
${OBJASM} ${ALFLAGS} -from rlib.s.rl_stub_r -to $@
lib.romcstubs: clib.s.cl_stub_rm
${OBJASM} ${AFLAGS} -from clib.s.cl_stub_rm -to $@
......@@ -503,9 +506,6 @@ lib.romastubs: rlib.s.rl_stub_a
lib.clib: ${CLIB_MOD_OBJS}
${LD} -o $@ -module ${CLIB_MOD_OBJS}
lib.arthurlib: o.arth_new_n o.arth_old_n o.ArtAsm_n o.ArtAsm_o
${LIBFILE} ${LIBFLAGS} $@ o.Arth_new_n o.Arth_old_n o.ArtAsm_n o.ArtAsm_o
# Derived headers:
derived.swis: s.makehswis h.swisheader s.swioptions
${AS} ${AFLAGS} -from s.makehswis -to $@
......@@ -630,28 +630,28 @@ o.kernel: kernel.s.k_obj_r
${OBJASM} ${AFLAGS} ${ALFLAGS} -from kernel.s.k_obj_r -to $@
rm_o.bsearch_a: c.bsearch
${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} -zkA -o $@ c.bsearch
${CC} ${CFLAGS} -ffah -zm1 ${CSFLAGS} -zkA ${OPTIONS} -o $@ c.bsearch
rm_o.clib: clib.s.cl_obj_r
${OBJASM} ${AFLAGS} -from clib.s.cl_obj_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.cl_obj_r -to $@
rm_o.cl_modbody: clib.s.cl_mod_r
${OBJASM} ${AFLAGS} -from clib.s.cl_mod_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.cl_mod_r -to $@
rm_o_rl.rl_modbody: rlib.s.rl_mod_r
${OBJASM} ${AFLAGS} -from rlib.s.rl_mod_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from rlib.s.rl_mod_r -to $@
rm_o.k_modbody: kernel.s.k_mod_r
${OBJASM} ${AFLAGS} -from kernel.s.k_mod_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from kernel.s.k_mod_r -to $@
rm_o.memcpy: s.memcpy s.h_regs
${OBJASM} ${AFLAGS} -from s.memcpy -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from s.memcpy -to $@
rm_o.initmodule: clib.s.initmod_r
${OBJASM} ${AFLAGS} -from clib.s.initmod_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from clib.s.initmod_r -to $@
rm_o_rl.initmodule: rlib.s.initmod_r
${OBJASM} ${AFLAGS} -from rlib.s.initmod_r -to $@
${OBJASM} ${AFLAGS} ${ASFLAGS} ${OPTIONS} -from rlib.s.initmod_r -to $@
#
# Objects that require extra flags
......@@ -666,10 +666,10 @@ o.string: c.string
${CC} ${CFLAGS} -fah ${CLFLAGS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string
rm_o.armsys: c.armsys
${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${VSFLAGS} -o $@ c.armsys
${CC} ${CFLAGS} -ffah -zm1 ${CSFLAGS} ${OPTIONS} ${VSFLAGS} -o $@ c.armsys
rm_o.string: c.string
${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string
${CC} ${CFLAGS} -ffah -zm1 ${CSFLAGS} ${OPTIONS} -DSEPARATE_MEMCPY -DSEPARATE_MEMSET -o $@ c.string
#
# Special case: use "rom_defs" for ROM library (o_rm), "defs" for the others
......@@ -683,6 +683,10 @@ o_rl.poll: rlib.s.poll
${CP} rlib.s.defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.poll o_rl.poll ${AFLAGS}
o_rl.bastxt: rlib.s.bastxt
${CP} rlib.s.defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.bastxt o_rl.bastxt ${AFLAGS}
m_o_rl.swi: rlib.s.swi
${CP} rlib.s.defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.swi m_o_rl.swi ${AFLAGS}
......@@ -691,13 +695,21 @@ m_o_rl.poll: rlib.s.poll
${CP} rlib.s.defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.poll m_o_rl.poll ${AFLAGS}
m_o_rl.bastxt: rlib.s.bastxt
${CP} rlib.s.defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.bastxt m_o_rl.bastxt ${AFLAGS}
rm_o_rl.swi: rlib.s.swi
${CP} rlib.s.rom_defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.swi rm_o_rl.swi ${AFLAGS}
${OBJASM} rlib.s.swi rm_o_rl.swi ${AFLAGS} ${OPTIONS}
rm_o_rl.poll: rlib.s.poll
${CP} rlib.s.rom_defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.poll rm_o_rl.poll ${AFLAGS}
${OBJASM} rlib.s.poll rm_o_rl.poll ${AFLAGS} ${OPTIONS}
rm_o_rl.bastxt: rlib.s.bastxt
${CP} rlib.s.rom_defs rlib.s.asmdefs ${CPFLAGS}
${OBJASM} rlib.s.bastxt rm_o_rl.bastxt ${AFLAGS} ${OPTIONS}
#
# trace separated out to allow defining of TRACE
......@@ -709,21 +721,6 @@ m_o_rl.trace: rlib.c.trace
${CC} ${CFLAGS} -ffah ${DFLAGS} -zM -DTRACE -o m_o_rl.trace rlib.c.trace
rm_o_rl.trace: rlib.c.trace
${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${STK_EXTN} -DTRACE -o rm_o_rl.trace rlib.c.trace
#
# Arthur objects
#
o.arth_new_n: c.arthur
${CC} ${CFLAGS} -fah -o $@ c.arthur
o.arth_old_n: c.arthur
${CC} ${CFLAGS} -fah -DARTHUR_OLD_NAMES -o $@ c.arthur
o.ArtAsm_n: s.Art_n_r
${OBJASM} ${AFLAGS} -from s.Art_n_r -to $@
o.ArtAsm_o: s.Art_o_r
${OBJASM} ${AFLAGS} -from s.Art_o_r -to $@
${CC} ${CFLAGS} -ffah ${DFLAGS} -zm1 ${CSFLAGS} ${STK_EXTN} ${OPTIONS} -DTRACE -o rm_o_rl.trace rlib.c.trace
# Dynamic dependencies:
| Copyright 2000 Pace Micro Technology plc
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
wimpslot -min 1000k
echo amu_machine SCL_APCS="-APCS 3/26bit" lib.stubs lib.risc_oslib lib.riscoslibm lib.clib lib.ansilib
amu_machine SCL_APCS="-APCS 3/26bit" lib.stubs lib.risc_oslib lib.riscoslibm lib.clib lib.ansilib
echo MkLibs: all done
......@@ -6,9 +6,9 @@
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "5.05"
Module_Version SETA 505
Module_MajorVersion SETS "5.06"
Module_Version SETA 506
Module_MinorVersion SETS ""
Module_Date SETS "28 Apr 2000"
Module_FullVersion SETS "5.05"
Module_Date SETS "09 May 2000"
Module_FullVersion SETS "5.06"
END
/* (5.05)
/* (5.06)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 5.05
#define Module_MajorVersion_CMHG 5.06
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Apr 2000
#define Module_Date_CMHG 09 May 2000
#define Module_MajorVersion "5.05"
#define Module_Version 505
#define Module_MajorVersion "5.06"
#define Module_Version 506
#define Module_MinorVersion ""
#define Module_Date "28 Apr 2000"
#define Module_Date "09 May 2000"
#define Module_FullVersion "5.05"
#define Module_FullVersion "5.06"
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* > C.Arthur */
/* Copyright (C) Acorn Computers Ltd., 1988 */
#include "arthur.h"
#include <stdarg.h>
/*
** Things in the Arthur C library.
**
** See also S.ArthurAsm for the OS bits
*/
int art_osbyte1(int, int);
art_error *art_osbyte(art_reg_set *regs)
{
return art_swix(OS_Byte, regs);
}
int art_osbyte1(int num, int arg)
{
art_reg_set a;
a.r[0] = num;
a.r[1] = arg & 0xff;
a.r[2] = arg >> 8;
arg = (int)art_osbyte(&a);
return (a.r[1] & 0xff) | (a.r[2] << 8);
}
art_error *art_osword(int action, void *data)
{
art_reg_set a;
a.r[0] = action;
a.r[1] = (int)data;
return art_swix(OS_Word, &a);
}
art_error *art_osgbpb(art_osgbpb_block * data)
{
return art_swix(OS_GBPB, (art_reg_set *)data);
}
art_error *art_osfile(art_osfile_block *data)
{
return art_swix(OS_File, (art_reg_set *)data);
}
art_error *art_osargs(art_reg_set *regs)
{
return art_swix(OS_Args, regs);
}
art_error *art_osfind(art_reg_set *regs)
{
return art_swix(OS_Find, regs);
}
int art_adval(int x)
{
return art_osbyte1(128, x);
}
void art_clg()
{ art_vdu(16);
}
void art_cls()
{ art_vdu(12);
}
void art_colour(int c)
{ art_vdu(17);
art_vdu(c);
}
/* note: cursor ends up on circle */
void art_circle(int x,int y,int r)
{ art_move(x,y);
art_plot(0x95,x+r,y);
}
void art_circlefill(int x,int y,int r)
{ art_move(x,y);
art_plot(0x9D,x+r,y);
}
void art_cursor(int c)
{
art_vduq(23,1,c,0,0,0,0,0,0,0);
}
void art_draw(int x,int y)
{ art_vdu(25);art_vdu(5);
art_vduw(x);art_vduw(y);
}
void art_drawby(int x,int y)
{ art_vdu(25);art_vdu(1);
art_vduw(x);art_vduw(y);
}
void art_fill(int x,int y)
{
art_plot(0x85,x,y);
}
void art_gcol(int a,int b)
{ art_vdu(18);art_vdu(a);art_vdu(b);
}
void art_gwindow(int a,int b,int c,int d)
{ art_vdu(24);art_vduw(a);art_vduw(b);art_vduw(c);art_vduw(d);
}
int art_inkey(int n)
{
n=art_osbyte1(129,n);
if ((n & 0xFF00) == 0xFF00) return -1;
return n;
}
void art_mode(int n)
{ art_vdu(22);
art_vdu(n);
}
/*
art_mouseX();
art_mouseY();
art_mouseB();
*/
void art_move(int x,int y)
{ art_vdu(25);art_vdu(4);
art_vduw(x);art_vduw(y);
}
void art_moveby(int x,int y)
{ art_vdu(25);art_vdu(0);
art_vduw(x);art_vduw(y);
}
/* mandel() ? */
void art_origin(int x,int y)
{ art_vdu(29);art_vduw(x);art_vduw(y);
}
void art_palette(int l,int p,int r,int g,int b)
{ art_vdu(19);art_vdu(l);art_vdu(p);art_vdu(r);art_vdu(g);art_vdu(b);
}
void art_plot(int n,int x,int y)
{ art_vdu(25);art_vdu(n);
art_vduw(x);art_vduw(y);
}
int art_point(int x,int y)
{
short block[3];
block[0]=x;
block[1]=y;
block[2]=0; /* to zero high byte */
x = (int)art_osword(9,block);
return block[2];
}
int art_pos()
{ return art_osbyte1(134,0) & 0xFF;
}
void art_rectangle(int x,int y,int l,int h)
{
art_move(x,y);
art_drawby(0,h);
art_drawby(l,0);
art_drawby(0,-h);
art_drawby(-l,0);
}
void art_rectanglefill(int x,int y,int l,int h)
{
art_move(x,y);
art_plot(0x61,l,h);
}
unsigned art_rnd(unsigned n)
{
extern unsigned rand(void);
return rand()%n+1;
}
void art_stringprint(char *s)
{
while (*s) art_vdu(*s++);
}
void art_tab(int x,int y) { art_vdu(31);art_vdu(x);art_vdu(y); }
void art_tint(int type, int mask)
{
art_vdu(23);art_vdu(17);
art_vdu(type & 3);
art_vdu((mask << 6) & 0x0c0);
art_vduw(0);art_vduw(0);art_vduw(0);
}
/*
** array of length of sequence for vdu codes
** it is assumed that the correct number of arguments has been supplied
*/
static char Qlen[32] =
{ 1, /* VDU 0 */
2, /* next character to printer only */
1, /* printer on */
1, /* printer off */
1, /* print at text cursor */
1, /* print at graphics cursor */
1, /* enable VDU driver */
1, /* beep */
1, /* backspace */
1, /* forward space (horizontal tab) */
1, /* line feed */
1, /* up a line */
1, /* clear (text) screen */
1, /* carriage return */
1, /* page mode on */
1, /* page mode off */
1, /* clear graphics window */
2, /* define text colour */
3, /* define graphics colour */
6, /* define logical colour */
1, /* restore default palette */
1, /* disable VDU drivers */
2, /* Select screen mode */
10, /* VDU 23,.. */
9, /* set graphics window */
6, /* PLOT ... */
1, /* restore default windows */
1, /* ESCAPE char - no effect */
5, /* define text window */
5, /* define graphics origin */
1, /* home cursor */
3 /* tab cursor */
/* and all the rest are 1 */
};
/*
** send the appropiate number of characters to art_vdu()
** it is assumed that the correct number of arguments has been supplied
*/
void art_vduq(int c,...)
{ va_list ap;
int n;
art_vdu(c);
if (c>=' ') return;
va_start(ap,c);
n=Qlen[c];
while(--n)
{ art_vdu(va_arg(ap,int));
}
va_end(ap);
}
int art_vpos()
{
return art_osbyte1(134,0) >> 8;
}
/******************************************************************************
Now for the new sound functions
******************************************************************************/
void art_sound(chan, amp, pitch, dur, futime)
int chan, amp, pitch, dur, futime;
{
art_reg_set a;
a.r[2] = (chan &0x0000ffff) | (amp << 16);
a.r[3] = (pitch & 0x0000ffff) | (dur << 16); /* compact bits */
if(futime != -2) {
a.r[0] = futime;
a.r[1] = 0;
a = art_swi(Sound_QSchedule, &a);
}
else
a = art_swi(Sound_Sound, (art_reg_set *)(8 + (int)(&a))); /* fast! */
}
void art_sound_on()
{
art_reg_set a;
a.r[0] = 2;
a = art_swi(Sound_Enable, &a);
}
void art_sound_off()
{
art_reg_set a;
a.r[0] = 1;
a = art_swi(Sound_Enable, &a);
}
void art_voices(int chan)