Author Topic: Little Clock Project (BASIC)  (Read 303 times)

0 Members and 1 Guest are viewing this topic.

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 336
  • Country: de
  • Liked: 185
  • Likes Given: 99
Little Clock Project (BASIC)
« on: 03:51, 21 March 21 »
Ok, I display a Clock with |TIME from M4 Board and read the output with COPYCHR$ to set a reminder/alarm, is there a way to replace this, so it will work on CPC 464 with Basic 1.0 ?


Code: [Select]
110 MODE 1
112 i$="none"
115 LOCATE 10,12:PRINT"Reminder : ";i$
120 LOCATE 10,10:|TIME
130 x=10:y=10:FOR n=1 to 5:LOCATE x,y:a$(n)=COPYCHR$(#0):x=x+1:NEXT n:z$=a$(1)+a$(2)+a$(3)+a$(4)+a$(5)
140 r$=INKEY$:IF r$="r" THEN GOTO 500
150 IF z$=i$ THEN SOUND 1,100,100:SOUND 1,0
160 GOTO 120
500 CLS:LOCATE 10,12:INPUT"Reminder (xx:xx) ",i$
502 IF i$="" THEN i$="none"
505 CLS
510 GOTO 115
1000 GOTO 120




Offline Nicolas Lecoq

  • CPC464
  • **
  • Posts: 26
  • Country: fr
  • 3CPC 6128, 3CPC 464, Oric Atmos, TO7.
  • Liked: 16
  • Likes Given: 108
Re: Little Clock Project (BASIC)
« Reply #1 on: 10:45, 21 March 21 »
Very good. But It beeps during one minute!
« Last Edit: 10:50, 21 March 21 by Nicolas Lecoq »

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 336
  • Country: de
  • Liked: 185
  • Likes Given: 99
Re: Little Clock Project (BASIC)
« Reply #2 on: 16:36, 21 March 21 »
I know, it's still work-in-progress :D


You can stop it by pressing "r" and hit enter without putting a time there :)


Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 336
  • Country: de
  • Liked: 185
  • Likes Given: 99
Re: Little Clock Project (BASIC)
« Reply #3 on: 03:05, 22 March 21 »
Ok, I found some note on Sean McManus site and changed the code !


Code: [Select]
10 DATA dd,7e,00,cd,b4,bb,f5,cd,60,bb,32,00,00,f1,c3,b4,bb
20 addr=40000:FOR g=0 to 16:READ d$:POKE addr+g,VAL("&"+d$):NEXT
110 MODE 1
112 i$="none"
115 LOCATE 10,12:PRINT"Reminder : ";i$
120 LOCATE 10,10:|TIME
130 x=10:y=10:FOR n=1 to 5:LOCATE x,y:CALL 40000,0:a(n)=PEEK(0):x=x+1:NEXT n:z$=CHR$(a(1))+CHR$(a(2))+CHR$(a(3))+CHR$(a(4))+CHR$(a(5))
140 r$=INKEY$:IF r$="r" THEN GOTO 500
150 IF z$=i$ THEN SOUND 1,100,100:SOUND 1,0
160 GOTO 120
500 CLS:LOCATE 10,12:INPUT"Reminder (xx:xx) ",i$
502 IF i$="" THEN i$="none"
505 CLS
510 GOTO 115
1000 GOTO 120

But it crashes after about 20 Seconds, does this overflow the memory ? Do I have to do some clearing of a mem area ?
« Last Edit: 03:08, 22 March 21 by SkulleateR »

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 336
  • Country: de
  • Liked: 185
  • Likes Given: 99
Re: Little Clock Project (BASIC)
« Reply #4 on: 10:13, 22 March 21 »
Doh  :doh:


Sorry, noobs mistake, forgot to protect the routine at 40000 to be overwritten by basic, now it works on CPC 464 + M4 Board


Code: [Select]
10 DATA dd,7e,00,cd,b4,bb,f5,cd,60,bb,32,00,00,f1,c3,b4,bb
20 addr=40000:FOR g=0 to 16:READ d$:POKE addr+g,VAL("&"+d$):NEXT
50 MEMORY 39999
110 MODE 1
112 i$="none"
115 LOCATE 10,12:PRINT"Reminder : ";i$
120 LOCATE 10,10:|TIME
130 x=10:y=10:FOR n=1 to 5:LOCATE x,y:CALL 40000,0:a(n)=PEEK(0):x=x+1:NEXT n:z$=CHR$(a(1))+CHR$(a(2))+CHR$(a(3))+CHR$(a(4))+CHR$(a(5))
140 r$=INKEY$:IF r$="r" THEN GOTO 500
150 IF z$=i$ THEN SOUND 1,100,100:SOUND 1,0
160 GOTO 120
500 CLS:LOCATE 10,12:INPUT"Reminder (xx:xx) ",i$
502 IF i$="" THEN i$="none"
505 CLS
510 GOTO 115
1000 GOTO 120



« Last Edit: 10:16, 22 March 21 by SkulleateR »