ddd00000ff00fe0080888000a3f ^7********************************************************************* ^7* * ^7* * ^7* ^2P r o g r a m P a r l o u r 3 - AMOS Communications ^7* ^7* * ^7* * ^7********************************************************************* ^2 By Ben Ashley ^6 Welcome to yet another issue of TA, and another installment of ^6Program Parlour. Again, something different this time, and something ^6useful to all people who either own 2 Amiga's and a serial link, ^6and/or a modem. ^6 What you exactly do with the serial extension is up to you. Writing ^6SERIAL-LINK games is quite easy, whilst writing Terminal software is ^6a little more difficult, and BBS software, is even worse. I'll ^6provide as much information as I can on all 3 of these types of ^6communications software. ^2 The Serial-Linkup Experience ^6 You don't have to be very intelligent to understand this. Very ^6simply, its easy. ^6 Imagine you want to create a game with 2 bobs, one at the top, one ^6at the bottom, and they can fire at each other. Bob 1 is controlled ^6on Amiga 1, and Bob2 is controlled, by another person on Amiga 2. ^6 If you can imagine the general variables, ( X,Y,X2,Y2 ), then a ^6routine like this would work fine.... ^2Do ^2 Gosub WAIT ^2 Serial Send 0,Str$(X) : Gosub WAIT ^2 X2=Val(Serial Input$(0)) : Gosub WAIT ^2 Serial Send 0,Str$(Y) : Gosub WAIT ^2 Y2=Val(Serial Input$(0)) : Gosub WAIT ^2 Bob 1,X,Y,1 ^2 Bob 2,X2,Y2,2 ^2Loop ^2' ^2WAIT: ^2While Serial Check(0)=0 : Wend ^2Return ^6 That basically displays both players on both screens, if that ^6program was being run on both computers. ^2 The Terminal Experience ^6 I'm not going to give you whole listings on terminal software, but ^6I'll give you one of the best routines you'll find, concerning AMOS ^6Communications ( Probably the only routine ). ^6 The following routine, is SO versatile, you could log on to a BBS ^6with it, and do almost everything but file transfer! ^2 The Routine Explained ^6Well, basically..... ^401.Start a Do...Looop ^402. Get any keyboard inputs, into TEX$ ^403. Check to see if there are any keypress.. ^404. Make V$=TEX$ ^405. Make J=1 ^406. End the If ^407. Check to see if J=1 ^408. Reset J, to 0 ^409. Send the String V$ to the serial port ^410. Wait until the Serial Channel is Free Again ^411. End the If ^412. Set I$ to anything coming in over the Serial Channel ^413. If There IS something coming through over the line.. ^414. Add I$ to J$. J$ is used for Connecting checks, etc. ^415. Check to see if the CONNECT string has been received. ^416. Reset j$ ^417. Set The CONNECT string to one. ^4 (Useful for BBS's) ^418. End The If ^419. Set up a For...Next... Loop, to the length of I$. ^420. Check to see if Any Carriage return/Line Feed ^4 codes ^421. Reset J$ ^422. End the If ^423. Next.... ^424. Again, set up a NEW loop, for the length of I$ ^425. Is there a FORM FEED character code in there? ^426. Clear the Output/Input Screen ^427. End The IF ^428. Next.... ^429. Make sure no control codes. ( More later ) ^430. Output Anything Which has come in ^431. End the If ^432. End the IF ^433.Finish The Loop ^1 BASIC ROUTINE ^201. Do ^202. TEX$=Inkey$ ^203. If TEX$<>"" ^204. V$=TEX$ ^205. J=1 ^206. End If ^207. If J=1 ^208. J=0 ^209. Serial Send 0,V$ ^210. While Serial Check(0)=0 : Wend ^211. End If ^212. I$=Serial Input$(0) ^213. If I$<>"" ^214. J$=J$+I$ 1^25. If Right$(J$,7)="CONNECT" and Not(CONNECT=1) 1^26. J$="" ^217. CONNECT=1 ^218. End If ^219. For F=1 To Len(I$) ^220. If Mid$(I$,F,1)=Chr$(13) or(Mid$(I$,F,1)=Chr$(10)) ^221. J$="" ^222. End If ^223. Next F ^224. For J=1 To Len(I$) ^225. If Mid$(I$,J,1)=Chr$(12) ^226. Cls 0 ^227. End If ^228. Next J ^229. If CODE=0 ^230. Print I$; ^231. End If ^232. End If ^233. Loop ^4 The connect variable, is very useful, when making COMMS packages. ^4Basically, if someone has connected to your modem, then this variable ^4will be set to one. An easy check eh? ^4 Host machines, send control codes to tell the terminal program what ^4to do. Here are some of the useful ones you'll need to know. 2 of ^4them are already in the listing above... ^1 CHR$(code) - ^2Function ^1 07 - ^2Bell ^4(Sound, or sample) ^1 10 - ^2Linefeed ^4(Used with CR) ^1 12 - ^2FormFeed ^4(Just clear Screen) ^1 13 - ^2Carriage Return ^4(Used with LF) ^1 27 - ^2Escape Code ^4(Used with ANSI) ^4 All this is fine, if you're doing Terminal/BBS software. But when ^4it comes to games, none of this is needed. You just write your own ^4transfer routines. Its very easy with games, as you know what is ^4going to be sent, and when, all the time. A Serial Link game, could ^4have as little as 10 lines worth of actual serial TX/RX. ^4 When writing terminal software though, things get worse. You don't ^4always know what`s going to be sent, so you have to analyze what's ^4coming in. Is it a control code? Is it ANSI? Things like this get ^4very confusing. Although, in 33 lines, you can do most things, in ^4reality, you need many more, to make it usable. ^4 My COMMS program, Bcomm, uses the EXACT routine above, although a ^4few things are added here and there. But, it is over 3000 lines ^4long. Why? Well, because of ALL of the available options. These ^4days, a comms package cannot be just ok. It has to be something ^4special. The good point about BCOMM, is the fact that it is user ^4friendly, and it looked good. BCOMM has over 120 variables, ^4including about 10 dimension arrays. ^2 The HOST Experience ^4 Next up, and the most difficult to produce, is BBS software. In ^4reality, it is quite simple, but if you want it to compete with other ^4BBS's which are on-line now, it has to be absolutely excellent. ^4 Luckily though, you don't just have to beat other boards' software. ^4It's what is contained on the BBS which is the most important. Users ^4don't want to be hanging around reading title text, which goes on for ^4pages and pages. The quicker they get into the BBS itself, the ^4better. ^4 The actual coding of the BBS, is much the same as the terminal, ^4except that it's on a bigger scale. It must provide the user with ^4easy access. You MUST have a Hard Disk to even think about starting ^4a BBS. Because it HAS to be able to handle the vast amounts of data ^4coming in from around the world. Well, actually, it depends. If ^4your BBS is not often contacted you'll get away with a small HD, but ^4if it's a well used board, the last message a logged-on user will ^4want to see, is HD FULL! So, make sure you're equipt. ^4 I'm about to soon start writing a BBS editor. It will essentially ^4be BCOMM v2.0. And I had an excellent tip from Paul Roffrey, SYSOP ^4of Amiga Connection. He said the best way to go about it, was to ^4write the BBS as a DATABASE, and then add all of the serial bits ^4later on. ^1I can be contacted at: ^2 331 London Road ^2 Stoneygate ^2 Leicester ^2 LE2 3NE ^2 Or Telephone: ( 0533 ) 705630 ^1Or, should you have a modem, I can be reached on: ^1 01 For Amiga ^2 Amiga Connection ^1 Amiga Information ^2 Digital Information Exchange ^1 Voyager ^2 Kneptune ^1 The Pig Pen ^4Just Mail me, as `Ben Ashley'. ^1Please feel free to contact me if you have any problems, or even if you ^1have any AMOS problems at all! ^3 ******** N O T I C E ********* ^6 I am now an official member of TECHNICAL FRED SOFTWARE. ODYSSEY ^6SOFTWARE is still going, but sort-of-like, UNDER Technical Fred. ^4----------------------------------------------------------------------- ^1 If all you wanted to do, was to mail the SYSOP, or leave messages ^1then this is fine. File Transfering is more difficult, and is ^1covered in the next issue of TOTALLY AMOS...... ^2( A brilliant excuse to buy the next issue of course ! ) ^4---------------------------------------------------------------------- ^2 Written by Ben Ashley, of ODYSSEY SOFTWARE 1992 ^4--------------------------------------------------------------------- /