From: sjd@wg.icl.co.uk (Steve Dickinson)
Subject: Re: Pseudo Random Numbers.
Date: 15 Oct 1996 08:22:45 GMT
Reply-To: sjd@wg.icl.co.uk

>Steve Dickinson (sjd@wg.icl.co.uk) wrote:
>:Can you explain why you think the in-built pseudo random number generator is
>:naff ? I'd be interested to know. Have you done any statistical analysis on its
>:output ?
>
>I've done no statistical analysis on the output, but by inspection it looks
>dubious. Probably good enough for a GA or similar (incidently, anyone use
>genetic algorithms on the Psion?) where the numbers don't have to be perfectly
>random, just create some noise.

Yes, I've being doing some GA / GP (Genetic Algorithms / Genetic Programming) on
my Psion - that was why I asked you to elaborate on your findings: A recent 
thread on comp.ai.genetic (I think) really thrashed the topic of good/bad 
random number generators. (I think the result was inconclusive, ie. some 
thought that a bad random number generator would affect the GA so much that 
it would not work, the others said the it didn't matter a jot !)

>The dice simulator is where it falls over.
>
>:DATETOSECS(YEAR,MONTH,DAY,HOUR,MINUTE,SECOND)
>
>This falls over when the code is called twice in the same second - not at
>all unreasonable for the dice problem.

Ah, yes but that was my point. You only use RANDOMIZE DATETOSECS( ... ) at 
the very start of the program. Random numbers are then created using RND 
(eg. x=RND). It does not matter if the x=RND is used twice in the same second. 
However, note most random number generators are _less_ random in their 
low-order bits. This doesn't normally have much impact with floating-point 
random numbers, since they are normally used like ...

IF RND<0.5
   REM head
ELSE
   REM tail
ENDIF

Of course, I've not tried a dice-simulator program (is this one of the 
examples in the OPL programming manual ?) - I might too find that it's 
totally crap ! ;-)

From: tele@tubul.active.ch (Patrick Seemann)
Subject: Re: Pseudo Random Numbers.
Reply-To: tele@acm.org (Patrick Seemann)
Date: Tue, 15 Oct 1996 16:27:05 GMT

>:DATETOSECS(YEAR,MONTH,DAY,HOUR,MINUTE,SECOND)
>
>This falls over when the code is called twice in the same second - not at
>all unreasonable for the dice problem.

There is _no_ need to call RANDOMIZE more than once in a program.

I did some dice testing over the weekend. The statistics after 40'000
calls to RND don't look to bad, so I don't think that you get bad
results from using the builtin function.

Otherwise, there is always (PI + x)^8 and just keeping the part behind
the decimal point. 

gruss, pat
-- 
Good judgement comes from experience. Experience comes from bad judgment.

From: alanc@donor2.demon.co.uk (Alan Clifford)
Date: 16 Oct 96 22:28:01
Subject: Timer functions?
To: lswab@bnr.ca

Replying to a message of Lyndon Swab to All:

 LS> I intend to write a darkroom timer application.  I've never written
 LS> anything in OPL, so I copied an OPL programming manual from the net.
 LS> It doesn't say anything about timer functions.  

 LS> What I'm looking for are functions similar to what most operating
 LS> systems provide, e.g.:         - sleep for x number of seconds.        
 LS> - call procedure y when time equals z.         - call procedure y at
 LS> interval of z seconds.

I'm using a timer call at the moment.  Here are the basic of a 2 timer, timer.
You should get the Psionics files for this sort of thing.

Alan

PROC timer:
 rem Psion...Esc to end
 local tstat1%, thdl1%, tdelay1&
 local tstat2%, thdl2%, tdelay2&

 IOOPEN (thdl1%,"TIM:", -1)
 IOOPEN (thdl2%,"TIM:", -1)

 tdelay1& = 100  rem 10 tenths sec
 tdelay2& = 30  rem 3 tenths

 IOC(thdl1%,1,tstat1%, tdelay1&, tdelay1&) rem set up timer
 IOC(thdl2%,1,tstat2%, tdelay2&, tdelay2&) rem set up timer

 while 1
  print "waiting"
  iowait
  if tstat1% >= 0
   rem set up timer again
   IOC(thdl1%,1,tstat1%, tdelay1&, tdelay1&)
   print "timer 10 secs" rem call a function here
  endif
  if tstat2% >= 0
   rem set up timer again
   IOC(thdl2%,1,tstat2%, tdelay2&, tdelay2&)
   print "timer 3 secs" rem call a function here
  endif
 endwh
ENDP

From: Shift Co-Ordinator <Shiftc@esoc.esa.de>
Subject: Re: Encryption - How is it done ??
Date: Thu, 17 Oct 1996 16:40:47 +0000
Reply-To: RMunson@esoc.esa.de

Tony wrote:
 
> What sort of algorythm is used to encrypt files under Word etc ??? 
> Is there some sort of standard ?? 
> I am putting together a text reader application and want to have
> something similar. 
> Rgds, Bob.

Hi Bob/Tony 

Yes there is a standard. I don't know what it is though. :-)
BUT I do know that you can access it. There is a system call that you 
can use. I will quote the Psionics Syscalls

------------------Fn $8B Sub $35
GenMaskEncrypt fails
    CX: length of buffer
    SI: encryption control block
    DI: buffer holding data to be encrypted
Encrypts a block of data according to the encryption control block, 
which will be updated. The value of the encrypted data depend only on 
the original data and on the contents of the control block, which 
should normally be initialized by GenMaskInit. Provided that the 
control block is not modified in any other way, encrypting a block of 
data in two or more parts yields the same result as encrypting it all 
at once.

The current encryption algorithm operates on a byte by byte basis as 
follows.
For each data byte in turn, take the value of offset 16 in the control 
block (which will be from 0 to 15) and use it to select one of the 
first 16 bytes in the control block (that is, offset 16 = 0 selects 
offset 0, offset 16 = 1 selects offset 1, and so on). Add the selected 
byte to the data byte modulo $100. Finally, add 1, modulo 16, to 
offset 16 of the control block. 

An example of this algorithm in use can be found in the file WORD.FMT.
It is possible that future versions of this call may implement 
multiple encryption algorithms, so AL, BX, and DX - unused at present 
- should be set to zero.
------------------------------------------------------------------

Ok so now I re-read it. It does tell you the method. :-)

I suggest anyone doing even slightly serious programming downloads at 
least the SYSCALLS section of the Psionics files. Look for them at
http://www.CityScape.co.uk/users/cdwf/psion/psionics/

If that meant little to you read the introduction to syscalls. Or if 
still stuck, E-Mail me and I will attempt to translate.

And don't forget to say thanks to Clive Feather for writing them for 
us. (Even if he hasn't had time to write the WSERVER section yet. ;-)

Bob Munson
RMunson@esoc.esa.de


Subject: Re: Pseudo Random Numbers
Date: Fri, 18 Oct 1996 11:05:22 +0200
neil.roberts@mkbbs.co.uk wrote:
 
> dp>In article <mkbbs-16227@mkbbs.co.uk>, neil.roberts@mkbbs.co.uk
> dp>> writes: Just on the subject of random numbers, my monopoly game
> dp>> that I am  writing (see
> dp>> http://www.mag-net.co.uk/~martinr/neil/psion.html) doesn't  have
> dp>> very randomized dice at all. Whenever you play a two player game,
> dp>> you always get the same pattern of numbers.
> 
> dp>Are you using RANDOMIZE at the beginning of your program?
> dp>If not, it's logical that you always get the same numbers.
> 
> I suppose that's obvious...
> 
> I did once try using RANDOMIZE dattosecs thingy every time I called RND.
> Obviously that just kept the same numbers but they changed every second.
> I'll change it to the beginning of my program then, thanks.
> ---
>  CMPQwk #1.42 UNREGISTERED EVALUATION COPY

Maybe the following algorithm from "Numerical Recipes" can help. 
(I haven't tried it in OPL but it solved a similar problem with random 
numbers for CA Realizer)

At the start of the program:
1. RANDOMIZE
2. Make an array of random numbers (the optimal size must be found by trial 
   and error -- for CA Realizer 98 works fine)

When you need a random number subsequently:
1. Use RND to make a random number
2. Convert it to an index into the random-number array.
3. Fetch the indexed random number from the array --> USE this as result
4. Use RND to make a new random number
5. Put this new number into the array to replace the one you used

Of course, this algorithm doesn't solve every problem with bad random numbers 
but at least minimizes the size of runs (i.e. series of increasing or 
decreasing numbers)

Good luck!

Kjell

From: "Paul Hargreaves" <pauhar@symix.com>
Subject: Turning the password on and off
Date: Sun, 20 Oct 1996 11:47:32 GMT

Hi folks :-)

Using the Psionics file to turn off the password as follows.  p$ must
contain your current power-on password.

GLOBAL p$(8)
p$="PASSWORD" : REM Your power-on password for example !
PRINT "Go set your password status to ON"
GET
CALL($308b,0,0,0,ADDR(p$),0)
PRINT "SHOULD be off now!"
GET
CALL($308b,1,0,0,ADDR(p$),0)
PRINT "Now should be back on"
GET

Only problem seems to be is that the CALL turns the damn password control
back on no matter what I pass to it
For example
CALL($308b,$FFFF,$FFFF,$FFFF,ADDR(p$),$FFFF) will turn the password on.

Is it me, or is the psionics file wrong ??

Thanks
Paul Hargreaves
pauhar@symix.com 

From: "Worldman" <worldman@superscape.com>
Subject: Re: Contrast in OPL
Date: Wed, 23 Oct 1996 08:10:38 GMT

Nick Dawkins <ndawkins@pavilion.co.uk> wrote in article
<54ivb5$saf@s02-brighton.pavilion.co.uk>...
> Is there a way of changing the screen contrast in OPL ?
> 

Yes

I have tried to create a fade, but so far the system call does not seem to
work as it should.

x%=call($138e) returns the current contrast (4 bits)
you can then (supposedly) increment or decrement the contrast.
call ($128e,upordown%)
if upordown% is >127 it increments and if it is =<127 it decrements (I may
have these the wrong way round).
But as far as I can tell it will only work one way whatever the value.
Maybe someone else knows why.

Hope this is of some help
Jamie W.

From: li94005@sable.ox.ac.uk (Timothy Giles)
Subject: Re: Contrast in OPL
Date: 23 Oct 1996 16:06:06 GMT

Worldman <worldman@superscape.com> wrote:

>x%=call($138e) returns the current contrast (4 bits)

Yup, so the current contrast can be read by
	x%=call($138e) and 15

>you can then (supposedly) increment or decrement the contrast.
>
>call ($128e,upordown%)

I don't think this is quite right.   Here's a small procedure which changes
the screen contrast to the value given (cnew%) and returns the old contrast
(cold%).

PROC fade%:(cnew%,delay%)
local cold%,buf%(6),a%,b%,c%
cold%=call($138e) and 15
b%=1 :if cnew%<cold% :b%=-1 :c%=$ff :endif
a%=cold% :while a%<>cnew%
buf%(1)=$1200+c% :os($8e,addr(buf%()))
call($189,0,0,delay%)
a%=a%+b% :endwh
return cold%
ENDP

where 0 <= cnew% <= 15
and delay% >= 0

so for example:

f%=fade%:(0,2) :rem fades screen slowly out
fade%:(f%,2) :rem fade back in again

This can be used, for example, by a background program as an interesting
(and silent) way of attracting the users attention.
Eg.

f%=fade%:(0,0)
do
fade%:(15,0) :call($189,0,0,2)
fade%:(0,0) :call($189,0,0,2)
until key
fade%:(f%,0)

Check the Psionics Files for more information on the OS calls.
------------------------------------------------------------------
Tim Giles                        t.giles1@physics.oxford.ac.uk
(01865) 273460                   Lincoln College, Oxford. OX1 3DR
==================================================================


From: gmn@geac.co.nz (Greg Nikoloff)
Subject: Re: IrDA article re-post
Date: 24 Oct 1996 05:59:12 GMT

In article <326B5709.7035@ecs.soton.ac.uk>, krb@ecs.soton.ac.uk says...
>
>Greg Nikoloff (gmn@geac.co.nz) wrote:
>> 
>> For a better explanation of IrDA on the Psion, refer to my earlier 
>> post
>> - try http://www.dejanews.com and look for my surname [Nikoloff] in 

Anyway, for those who are interested, here is my post from about 5 
weeks back shortly after the 3c and siena was first announced, most of 
what I said then still stands, if there are any errors, then please 
accept them as mine, as they were probably due to my lack of knowledge 
at the time. Of course if I am right, then I also take the credit! 
However some of my comments have been proved correct by information I 
have since received from Psion and others [where later information 
either confirms or corrects/contradicts a comment I make, then I have 
indicated in the text of the article with a comment in brackets 
followed by a '- gmn' tag to show its a update.

Here is the article: as it was [mostly] posted:
--------------------------------------

Hello there folks, since the announcement of the New Psion 3c and Siena
[Siena - that sounds like one of those colours in those water paints 
you had as a kid right? :-)))]

There has been interest in the IrDA InfraRed port that is built into 
the Psions, and there has also been some consternation as to what 
exactly the IrDA port is good for given Psion saying how it will do 
Psion to Psion and  Psion to Printer connections [only]. [and even that 
functionality is in doubt according to some]. 
[Psion to Psion and Psion to Printer functionality is confirmed by 
those with the new Psions - gmn]

So, what follows is my own input on this area, I have spent some time 
over the Last 8 months or so looking at the IrDA protocol(s) and how 
they work and what they will and will not do. If there are any errors 
they are mine, I do encourage those who are interested to look at the 
IrDA specifications themselves the IRDA have their own web pages at 
www.irda.com - [or is it www.irda.org?] (the CORRECT URL is 
www.irda.org - gmn), they will give you the latest specs in postscript 
form [and maybe PDF by now [no such luck - ps/zip/word files only - 
gmn] ], which you can print out and study, they are a bit hard going, 
but do give some insight into what the issues are. 

1. the IrDA standard [IrDA stands for Infra-Red Data Association], is 
really several standards, there is one 'hardware' standard for the Ir 
part [the send and receive] LEDS etc, and several 'software' standards 
for the various communications 'layers' built on the hardware.

The physical part specifies a IR link running at half duplex [i.e. one 
way at a time], at speeds from 2400 baud [min] to 115Kbaud [max]. this 
raw IR link is used by one or several software protocols to form a 
'data link' from this one-way at a time link. This means the effective 
data throughput you actually get is somewhere less than 115Kbaud, and 
depends on the protocols being used, in practice about 100Kbaud for a 
device to printer link is probably achievable, for two way or file 
transfer, probably about 50kbaud is max, although this could get 
higher. 

There are newer revisions of the IR protocols which will support upto 
4MBit links, but the hardware for these is still expensive and not 
everyone is on the same wavelength as far standardisation goes. Still, 
there is nothing in the IrDA software protocols which limits the speed 
of them to 115Kbaud its simply the current hardware is limited to this 
speed. The hardware is very simple, simply a IR send LED and a IR 
receive LED, connected to some other hardware to generate and retrieve 
the clock signal and data signals in the IR data signal etc. Usually 
the two LEDS (send and receive are physically seperated from each other 
so that when the device is sending the receive LED does not see the IR 
signal being sent by the send LED].

2. The fact that most IrDA ports are both hardware and software, means 
that once the Irda hardware is built into a device, the software can be 
upgraded or enhanced later without the need to touch the hardware 
[unless of course the software is built into ROMs etc that need to be 
replaced].

3. There are 2 main IrDA protocols used to communicate over a IR link, 
[there are other protocols other than just these two, but for most 
people these are the two commonly implemented ones, and are the ones 
most likely used by devices to communicate - they do require lower 
level protocol to be in place as well, but these are the main program 
interface to the IR protocols for most users etc].

The first is called IRCOMM [and is a update to the RAW IR protocol, 
used in earlier IR links for printers - NOTE RAW IR may be the protocol 
Psion use for the Psion to Psion links yet to be confirmed - gmn].

IRCOMM allows emulation of 'legacy' serial and parrallel data links, 
except that the actual physical link is done via IR instead of 3 or 
more wires! It allows for the reporting of the serial port signals 
[e.g. DSR,CD,RTS,CTS etc] to the device on the other end of the IR
link, and thus can be made to be  'semi transparent' to the devices 
concerned.  [e.g. simply have a dumb Serial device which squirts data 
into a smart IRCOMM device, which talks to its countrpart across a IR 
link, and then talks in turn to another dumb Serial device].
It is this protocol which Psion have almost certainly implemented in 
the new Psions, and this would allow communcation to IR printers [e.g. 
HP5P], or to other Psions with IR ports.

The second main protocol is IRLAP, IRLAP is a two-way file and data 
transfer link protocol, which allows a reliable two-way link to be 
established over a IR link. It is a much more complicated protocol to 
implement than IRCOMM, not least because it has in-built link recovery 
etc if the IR beam is interrupted amoungst other things.
In order to use IRLAP you need the IRLAP protocol built into the two 
devices that communicate, in Psions case this would include the Psion 
AND the PC being used to send/receive files to/from. The way most PCs 
would gain the IRLAP protocol they currently miss is via a new version 
of Psi-Win [the IR version of PsiWin is yet to be released and is not 
in Psiwin 1.1 - gmn] and also some IR hardware that connects to the 
serial [or Parrallel?!] port of your PC.

The Psion would of course need to have the IRLAP protocol too, and this 
bit is probably still coming.

As you may have gathered to use the IR link to/from your PC you will 
need a IR device on your PC, some newer PCs come with the hardware 
built in, some do not, for those of us without such IR hardware 3rd 
parties already make such devices for hooking PCs to IR ports on 
laptops etc, these devices are made by companies such as Extended 
Systems and Adaptec [the Adaptec products go by the name of AirPort and 
cost about $USD100-150 for a pair of devices].
These usually come with file Xfer software such as Tranxit, which
support/have built in the IRLAP protocol needed to send files etc over 
the IR links.

Since as you have probably gathered the bulk of the 'smarts' in the IR 
links are the software and not the hardware, is quite feasible to 
release a device with in-built IR links and then add the software to 
make it work later, and this can be done quite cheaply too.

This is the approach I think Psion are taking, the most important thing
Psion did was build the IR port into the new Psions, the software can 
be added later, sure it would be nice to have the IR stuff built into 
ROM, but for sure there will be bugs in the IR stuff, and so a software 
upgrade would become needed anyway.

In the meantime as Psion have implemented some kind of IR protocol, it 
may be possible to send and recieve data over this link, although how 
you use the IR links as they stand is probably by device driver. 
[The Psion-Psion protocol which is used to send stuff to a Psion from 
another Psion is probably based on the IRCOMM protocol and as such it 
may be possible to write some software to be able to duplicate this 
behaviour from a PC.]

Imagine being able to cut & paste data from your PC to your Psion over 
a IR link! [still a way off - gmn]

Anyway, I hope this help explain a bit what the IR link in the new 
Psions will be able to do, of course it would be nice if they did it 
from day 1, but given that they will be able to use the Serial link 
will at least allow file Xfer to/from a PC.

The only thing I would like to know is: will the new Psions support use
of the Serial link AND the IR link at the same time [or is the IR link
using the serial link hardware at the low level?].

[The Serial port and the IR port use the same low-leve hardware, so its 
one or the other - gmn]

Greg Nikoloff
gmn@geac.co.nz
------------------------
End of orginal post.


From: gmn@geac.co.nz (Greg Nikoloff)
Subject: Re: Help needed with format of VideoPlus codes
Date: 23 Oct 1996 05:54:29 GMT

In article <3279212c.10189576@news.demon.co.uk>, tony@selby.demon.co.ukL 
says...
>
>Can anyone tell me how the "VideoPlus" codes shown beside UK TV
>program listings are encoded.
>
>Even better would be some source to decode the numbers.
>
>Please E-Mail any info you have.
>
>Rgds,
>Bob
>
>I'm not paranoid - they really are out to get me !

Bob, there are many places on the Internet that have some information
about VideoPlus codes [or VCR+ codes or G-codes depending on where you 
live in the world].

I suggest you consult the sci.crypt FAQ as this has some references to
the VCR plus [US version] encoding schemes etc, however be aware that 
most code implementations in C and are for the US VCR+ system rather 
than for the UK [each country etc has a unique algorithm that makes its 
VideoPlus codes unique/unuseable in other countries.]

The basic way plus codes works is this:

1. The 1-8 digit number you enter as the VideoPlus code is 'unscrambled' 
by a hash function to yield a number with the same # of digits [but with 
different digits i.e. a different number fro mthat you entered], this 
'raw' plus code number, has encoded in it, the 'slot#' of the program 
[how long the program is and when it starts], the day in the next month 
it occurs on, and also the channel it is on.

The system is designed so shorter numbers reflect 'prime time' slots 
[usually but not always 1/2 or 1 hour apart] and also indicates popular 
channels and program lengths etc.

Longer codes means odd lengths of programs [e.g. 2 hours 5 minutes], or
odd start times e.g. 21:17 and/or 'less common/popular channel' [this 
usually means higher numbered channel in the Videoplus 'channel list' 
they publish.

Since the code is from 1-8 or more digits long, the number of 'bits'
used is about 32, in this structure of 32 bits, some are time slot#, 
others encode channel # and the rest encode additional start time or 
length adjustments and/or additional channels.
[the lower bits encode the common codes for all days in a month in about 
8-10 bits [or about 3-4 digits] - leaving 24 bits for the not so common 
cases [i.e. all the other time slots in the month].

You may notice [if you look at the G-codes for a months TV listings], 
that generally [but *not always*] the last 3-4 digits of the codes are 
smaller at the start of the month and increase over the month with the 
last day in the month generally having the highest numbers.

[I say generally as the hash function makes sure that the numbers are 
scrambled enough to break this rule but if you 'unscramble' the plus 
codes into their 'raw' form [as processed by the VideoPlus device when 
you enter it], then this rule holds 100%, and from this you can deduce 
the time slot bits and channel bits for the popular channels at least.]

Also, the codes are valid for one month, [31 days], so if code from the 
previous or next month is entered, it will either come back as 'invalid' 
meaning this time etc has already expired this month, or decodes to a 
day not in the month etc [e.g. 31st of September] , or it will give a 
different date,start time,length and channel from the desired one.
This basically ensures that you need new TV listings [with fresh codes] 
each month.

So I hope that helps, one thing is that the longer codes [e.g. over 7 
digits] appear to have some odd encoding system, and as such it is 
unlikely that you will be able to determine by looking at the [raw] 
codes directly how these 'upper bits' are used in the codes. However, 
its not a impossible task, just takes some patience etc.

Greg Nikoloff
gmn@geac.co.nz


From: Cade Roux <cade@ix.netcom.com>
Subject: Re: HC Range 110 - Accessing the Serial Port
Date: Sat, 02 Nov 1996 05:48:25 GMT

In article <3277E36E.6287@titan.tcn.net>,
	Tim McCallum <ttcstats@titan.tcn.net> wrote:

>Hi all,
>
>I am having some difficulty accessing the Serial port in the top slot of
>an HC110.
>
>The programs I wrote worked with previous OS revisions but ever since I
>repro'd the units with SIBO 1.70f I have been unable to access serial
>devices in the top slot of a unit.
>
>I have a modem installed in the top (TTY:A)- my software attempts to
>open the port and nothing happens.  If I place the modem in the bottom
>(TTY:B) it works fine.
>
>Can anybody help me ??
>
>Thanks
>
>Tim McCallum
>Statistics Coordinator
>Toronto Transit Commission
>(416) 393 - 4464
>email : ttcstats@titan.tcn.net

I think 1.70 was replaced rather rapidly by 1.71? for some reason.  
I'm not sure it had anything to do with the expansion slots or not.  
Presumably 1.64 on the same unit works fine through the top slot?

I know there are definitely some differences in LINK (its preferences for 
ports) in later versions of the ROM (those released to handle the new LIF/HC 
cradle).  Possibly you have LINK running already on the top serial port 
(only one port can be open in each expansion slot at a time).  
Use TER LINK to ensure it is terminated (only works if you have an 
alphanumeric keyboard)

I'm not sure which modem you are using (Extech 2400 internal?), but when we 
use a Dynapen HC or Psion Dual Barcode Serial Port, we have to close the 
barcode port before attempting to print through the serial port - the error 
number returned if you don't is either device in use or something like that.

Good Luck,
Cade


From: unistein@isbe.ch (Peter Steiner)
Subject: Re: C SDK and make
Date: Tue, 05 Nov 1996 22:48:06 GMT

markson@incog.com (Tom Markson) wrote:

> Has anyone gotten the SIBO C SDK to work with standard makefiles instead
> of the the .pr project files?  The release notes for TopSpeed indicate
> this can be done with the "/link" option, but the compiler spits out an
> "unknown option" message when I try to use it.

I'm using Borland make. I couldn't get rid of the .pr files, but I'm
generating them with the makefile. I have appended an example
makefile, perhaps you can extract something useful from it. (Sorry
about the german comments, but thats how I'm used to write <g>)

Peter

---------------------------------- cut here --------------------------
# makefile for Borland make

all: liga.app

epocinit = iplib
version  = 0x100F
priority = 0x80
heapsize = 0x80

!ifdef RELEASE
  !message ========================================
  !message Uebersetzen OHNE Debugging-Informationen
  !message ========================================
  DEBUG = /v0           # keine Debug-Infos
!else
  !message =======================================
  !message Uebersetzen MIT Debugging-Informationen
  !message =======================================
  DEBUG = /v2           # alle Debug-Infos
!endif

OBJECTS = \
	main.obj \
	utils.obj

CLASSES = \
	ligacm.cl dialogs.cl \
	ligabw.cl \
	liga_doc.cl \
	tlv_file.cl lig_file.cl

RESOURCES = \
	liga.rss dialogs.rss

# Implizite Regeln
#-------------------------------------------------------------------------------

.exe.app:
	emake -b -a$*.afl -o$@ -s -v$(version) -p$(priority)
-h$(heapsize) -t1 $<

.exe.dyl:
	emake -b -d$*.dfl -o$* -s -v$(version) -p$(priority)
-h$(heapsize) -t4 $<

.c.obj:
	tscx /fpcompile.pr $(DEBUG) $<

.cat.c:
	ctran $< -c -s -v -l -e\l\sibosdk\include\ -x -g

.cat.g:
	ctran $< -c -s -v -l -e\l\sibosdk\include\ -x -g

.cl.g:
	ctran $< -c -s -v -l -e\l\sibosdk\include\ -x -g

.re.rg:
	rgprep $< $*.rex
	lprep -i\l\sibosdk\include\ -o$*.i $*.rex
	del $*.rex
	rgcomp $*.i $*
	del $*.i

.rss.rsg:
	rcomp -S$* -O$* -I\l\sibosdk\include\ -G$*

.rss.rsc:
	rcomp -S$* -O$* -I\l\sibosdk\include\ -G$*

.rsc.rzc:
	rchuf hwim -v -i$*

.ms.shd:
	makeshd $*

.pcx.pic:
	wspcx -p $*

#Explizite Regeln
#--------------------------------------------------------------

liga.app: liga.exe liga.shd liga.rzc liga.pic

liga.exe: link.pr liga.obj $(OBJECTS) $(CLASSES:cl=obj)
	tscx /l link.pr

liga.obj: liga.c liga.g compile.pr
	tscx /fpcompile.pr $(DEBUG) $*
	ecobj $@

liga.rsg: liga.rg $(RESOURCES)

liga.rg: liga.g liga.re

$(OBJECTS): compile.pr liga.rsg

$(CLASSES:cl=obj): $(CLASSES:cl=g) compile.pr liga.rsg

main.obj: liga.rsg

liga.c: liga.cat $(CLASSES)

# Compiler Konfigurations-Files
#-------------------------------------------------------------
# Abenteuerliche Konstruktion, um '#' in ein Makro zu bringen:
# Zuerst mit Anfhrungszeichen (damit es nicht einen Kommentar
# einleitet) und dann die Anfhrungszeichen wegsubstituieren
QUOTED = "#"
H = $(QUOTED:"=)

compile.pr:
	copy &&|
$(H)system epoc img
$(H)set epocinit=iplib
$(H)model small jpi
$(H)pragma optimize(speed=>off)
$(H)pragma optimize(cpu=>86)
$(H)pragma data(no_far_data=>on)
$(H)pragma define(EPOC=>1)
$(H)compile %main
| compile.pr

link.pr: makefile
	copy &&|
$(H)system epoc img
$(H)set epocinit=$(epocinit)
$(H)model small jpi
$(H)abort on
$(H)pragma debug(vid=>full)
$(H)pragma link_option(case=>on,oldexe=>on,pack=>off)
$(H)pragma linkfirst($(epocinit).obj)
$(H)pragma link(liga.obj)
$(H)pragma link(main.obj)
$(H)pragma link(ligacm.obj)
$(H)pragma link(dialogs.obj)
$(H)pragma link(ligabw.obj)
$(H)pragma link(utils.obj)
$(H)pragma link(liga_doc.obj)
$(H)pragma link(tlv_file.obj)
$(H)pragma link(lig_file.obj)
$(H)pragma link(olib.lib)
$(H)pragma link(hwim.lib)
$(H)pragma link(plib.lib)
$(H)pragma link(wlib.lib)
$(H)pragma link(rlib.lib)
$(H)dolink liga.exe
| link.pr

# eof
---------------------------------- cut here --------------------------


----------------------------------------------------------------------
Peter Steiner       unistein@isbe.ch      http://www.isbe.ch/~unistein

