From:  (Mario)
Newsgroups: comp.sys.hp48
Subject: Re: Chess clock for HP48
Date: Tue, 14 Jul 1998 10:15:27 GMT
Message-ID: <35ab136a.7049817@news.arrakis.es>
References: <6nhekm$jgk$1@nnrp1.dejanews.com>
X-Newsreader: Forte Free Agent 1.11/32.235
NNTP-Posting-Host: 195.5.70.157
X-Trace: 14 Jul 1998 12:12:01 +0100, 195.5.70.157
Lines: 108
Xref: republic.btigate.com comp.sys.hp48:13267

On Fri, 03 Jul 1998 02:11:33 GMT, Perez-Franco
<Perez-Franco@mindless.com> wrote:

>Hi!
>
>Wouldn't it be great to have a programm to emulate a chess clock (which are so
>expensive) in HP48?
>
>I think that it may be easy for an experienced programmer!
>
>All it has to do is to start running a clock when you press a key (let's say
>softkey A) and quit running that clock and run another clock when you press
>another key (let's say softkey F).
>
>Isn't that easy?
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Sometime ago I write this chess clock:

CHSCLK ( # 628Eh 317.5 by )

Arguments:

2: 0 < real <= 24 ( Max. whites time)
1: 0 < real <= 24 ( Max. blacks time)

real= real number with this format: hh.mmss
Examples:
 01.7085 (dec. base) = 02.1125 (six. base)
 00.5050 (dec. base) = 00.5050 (six. base) (not 00.3030 six base) 
All of them are valid arguments.


Running:

Press any key (except ON) to start the countdown of white player time
Any other key = change the countdown of players time 
[ON] key = exit program

Sysrpl code of CHSCLK :

::
 CK&DISPATCH1 REALREAL
 ::
  RCLSYSF SWAPROT # 29 SetSysFlag # 13 SetUserFlag BlankDA12
  $ "Whites:" DISPROW2 $ "Blacks:" DISPROW5
  GARBAGE WaitForKey TWO{}N { # 2D # 1 }
  EQUALcase :: 2DROP DOSTOSYSF COLA ;
  TOD
  ERRSET
  ::
   BEGIN
    TOD OVER %HMS- 3PICKSWAP %HMS- DUP %0< IT ERRJMP
    DUP TOD>t$ $ ":" &$ OVER %FP editdecomp$w # 6 # 7 SUB$ &$
    # 13 TestUserFlag ITE DISPROW3 DISPROW6
    KEYINBUFFER?
    ITE
    ::
      FLUSHKEYS UNROT2DROP SWAP TOD # 13 DUP TestUserFlag
      ITE ClrUserFlag SetUserFlag % 2000 % .05 DOBEEP
    ;
    DROP ATTN?
   UNTIL
  ;
  ERRTRAP
  ::
   DROP # 13 TestUserFlag ITE $ "Blacks" $ "Whites" $ " win" &$
   BlankDA12 DISPROW3 % 1200 %1 DOBEEP
  ;
  3DROP
  DOSTOSYSF
 ;
;

ASC file for Emu48 or hp48:
Copy and paste the text between cut lines into Notepad, save as
CHSCLK.ASC and load into Emu48 or hp48  (delete the wrong new-line
characters in file if this exist) then run ASC-> program with this
file in the stack. STO in CHSCLK file and run it

You can find ->ASC and ASC-> program in this site:
HP48 FAQ: <http://www.engr.uvic.ca/~aschoorl/faq/>


X===============================================
D9D202BF8199040D9D20736C133F069814013735DA04052735875A3C2A203100
0758696475637A3B6421C2A203100024C61636B637A3B942124F5056F149B136
47A2011920D20009FF30B2130EFC36D9D20852303E6C11DF60B2130AFBC0E5E4
0D9D202A170AFBC02C2308C6A2FDE268C6A288130837A2CB9161DE4088130A60
D0C2A2070000A3391502C230D4FA213B51B2040530403375039150DA04087735
8DA16B7421BA421204248DA16D9D2017D00A211632230AFBC0DA040881308773
58DA165573552735339203000000000000020339208990000000000050A5141B
213044230262248C170B21308BE40D9D2044230DA040877358DA16C2A2011000
24C61636B637C2A2011000758696475637C2A20D0000027796E639150875A3B7
4213392030000000000002109C2A2A5141B2130B4F063E6C1B2130B2130E826
X===============================================


====================================

Lo de siempre, quita BOND,JAMES_BOND
para tener mi direccin correcta

Mario de Lama <malar@BOND,JAMES_BONDarrakis.es>
http://www.arrakis.es/~malar/
http://www.arrakis.es/~jalarcon/