News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_SkulleateR

Little Clock Project (BASIC)

Started by SkulleateR, 02:51, 21 March 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SkulleateR

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 ?



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





Nicolas Lecoq

#1
Very good. But It beeps during one minute!

SkulleateR

I know, it's still work-in-progress :D


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


SkulleateR

#3
Ok, I found some note on Sean McManus site and changed the code !



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 ?

SkulleateR

#4
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



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





Powered by SMFPacks Menu Editor Mod