+ All Categories
Home > Documents > smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the...

smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the...

Date post: 23-Sep-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
9
smsqzine Issue #2 September 2015
Transcript
Page 1: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

smsqzineIssue #2 September 2015

Page 2: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

smsqzine

Published by:Timothy [email protected]@lanset.com

SMSQzine is published as aservice to the Sinclair QLcommunity. Writers are invitedto submit articles for publication.Readers are invited to submitarticle ideas.

Created using OpenSource Tools:

­ OpenOffice­ Scribus­ Gimp­ SMSQmulator

Copyright 2015Timothy Swenson

Creative Commons License­ Attribution­ Non­Commercial­ Share­Alike

You are free:

­ To copy, distribute,display, and performthe work.

­ To make derivitiveworks.

­ To redistribute thework.

table of contents

2nd Annual Midwest Timex/Sinclair Computerfest 1

QPC1 & DosBox 2

Astronomical Algorithms on the QL 4

Computer Graphics with Pascal 5

QL Benchmarks 6

Editorial 7

Page 3: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 1

2nd Annual Midwest Timex/SinclairComputerfest

Sinclair entered the American market with theZX80 and ZX81 through mail order. Timex, whowas manufacturing the ZX81, thought it could sell awhole lot of ZX81's through it's dealer network. InJuly, 1982, the Timex/Sinclair 1000 was introduced.

In November, 1983, the Timex/Sinclair 2068 wasintroduced as a re­worked Spectrum. With salesless than expected, Timex removed itself from thecomputer market in March, 1984. When theSinclair QL came out, those dealers that were stillsupporting the Timex/Sinclair's stepped up andcarried the QL. Unlike the UK, there was notenough QL's sold to create new user groups. TheTimex/Sinclair user groups covered all of theSinclair computers.

So, 3 years after Timex left the market and a yearafter the QL was discontinued, 700 attendeesgathered in a hotel in Indiana to discuss all things

Sinclair, from the ZX81 to the QL. On May 2ndand 3rd, 1987, the Second Annual MidwestTimex/Sinclair ComputerFest was held in

Indianapolis, Indiana. Tickets were $4 in advancedand $6 at the door. The event had a dealers roomand two smaller rooms set aside for talks. Theshow ran from 9 am to 6 pm on Saturday and 9 amto 5 pm on Sunday. On Saturday night a banquetwas held for the dealers and attendees. Most of theUS Sinclair dealers were at the show, along withrepresentatives from 9 user groups.

Some of the key organizers were Paul Holmgrenand Frank & Carol Davis, who later formedMechanical Affinity, a well­known Sinclair dealer.

Mark Steuber of Sharps, Inc, from Virginia wasthere. Mark was the writer of War in the East, apopular wargame for the QL, Spectrum, and ZX81.Also in attendance was Frank Toemay of QuantumComputer. Frank was known for running ads forthe QL in a number of well known trade magazineslike Dr. Dobb's Journal and Computer Language.

His description of the QL was a little over the topand made it sound like the best thing since slicedbread.

A key QL vendor at the show was A+ ComputerResponse of New Hampshire with the owners,George and Carol Wilham. Just before Sinclair soldwas sold to Amstrad, A+ purchased all US QL'sfrom Sinclair. The Wilhams worked out a deal withTerry Shurwood of Sinclair USA.

The photographs were taken by Tim Woods of TimeDesigns Magazine and Joe Williamson of FooteSoftware. They were posted Flikr by the userzxbruno.

Page 4: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 2

One thing of note. A+ Computer Response wasselling the base QL for $179 at the show. One ofthe pictures shows that they later dropped the priceto $99. Just a year before, the QL was going for$299 (I know, that is when I bought mine).

QPC1 and DosBox

Since I've migrated to Linux for my desktopsystem, my selection of QL emulators is not verybig. The best and my favorite is SMSQmulator. Itis fairly powerful, but it has limitations in that it isnot a QL emulator but a platform for SMSQ/E.This means that very early programs that only runon a QL, will not run on it.

QPC1 has recently been released and that looks tobe another option for me. I've heard that someprograms that will not run on SMSQmulator, mightrun better under QPC1. QPC1 is only for DOS,which leaves a bit of a quandary for a Linux user.Luckily, there is DosBox, which creates a DOS

environment, perfect for running QPC1. DosBox isprimarily designed for running old DOS gamesfrom the early to mid 1990's, but I've used it to runthe DOS version of the PSION programs with noissues. DosBox runs on a number of platforms,including Windows, Linux and Mac. It does a goodjob of providing a DOS environment for running anumber of DOS utilities. DosBox is freelyavailable from www.dosbox.com. Download thespecific version for your operating system andinstall it using the directions from the DosBoxwebsite.

I will assume that you know where to find QPC1and be able download it.

Configuring DosBox for QPC1

To get QPC1 to run on DosBox, three settings haveto change. Open the DosBox config (dosbox.conf)file using a text editor. See the DosBoxdocumentation to find out where your version islocated. For Linux, the config file is in the .dosboxdirectory. Find the EMX, XMS and UMB sectionof the file and set the following:

xms=falseems=falseumb=false

Setting up DosBox

DosBox can read the underlying file system of theoperation system, and can run DOS executablesfrom that file system. It is recommended to create aDOS directory and then place all DOS files in subdirectories under this directory. This will keep allof your DOS files in one location. One thing to

Page 5: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 3

remember, once DosBox is started, do not edit theDOS directory with the file system tools. DosBoxwill not notice any changes until it is restartedagain.

When DosBox is started, it will give a Z: drive asthe local directory. You can mount the DOSdirectory from the local file system like this:

mount c c:\dos ­Windowsmount c /home/user/dos ­Linuxc: ­ Move to C:\

Instead of doing this every time you fire upDosBox, you can add it to the autoexec part of theDosBox config file. Look for [autoexec] in theconfig file and add the above statements just afterit. These commands will be run each time DosBoxis started.

Starting QPC1

Once DosBox is started, just CD to the directorywhere QPC1 is located. For the first time runningQPC1, you will need to run the program "config"and set things like the keyboard and whatQXL.WIN files to use. Once that is done, execute'qpce' for English or 'qpcd' for German.

Hints with DosBox

Mouse

By default the mouse is trapped by DosBox, notallowing it to leave the DosBox window. Themouse can be untrapped by hitting CTRL­F10. To

turn this feature off, set "autolock=false" in theDosBox config file.

Larger Resolution

DosBox allows for higher resolution than VGA.QPC1 also allows for higher resolution. DosBoxand QPC1 has been successfully tested with aresolution of 1024x512. See the DosBox and QPC1documentation on how to change the resolution oneach.

Full Screen

DosBox can be set to full screen by using hittingALT­ENTER. Hitting this again, will turn off fullscreen. If using QPC1 in 512x256 mode, going fullscreen will enlarge all of the text making it easier tosee and provide for a more "normal" QLexperience.

Exit from QPC1

For those that don't remember, exiting from QPC1back to DosBox can be done by the QPC_EXITcommand. DosBox can be exited by clicking onthe (X) close box while QPC1 is running, butquitting from QPC1 is probably more graceful.Once back at the DOS prompt, 'exit' will exitDosBox.

Floppy Access

DosBox does not support low level access to floppydisks, even if they are attached, so don't expect touse floppy drives, even though QPC1 can directlyaccess floppies.

Page 6: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 4

Printer Access

DosBox does not support printers or the printer(LPT) port, which means that even if you usedsoftware that captures data to the LPT port andsends it to a file, it will still fail. There is a specialbuild, call Hal9000, of DoxBos that is reported tosupport the printer port. By printing to a file, it ispossible to have to host OS access the file and sendit to a printer.

DOS Access

QPC1 does not have the DOS1_ device that QPC2has. There is no way for QPC1 to access filesstored under the underlying file system. This alsomeans that there is no built­in way to transfer files

from DOS to a QXL.win file and back. JonathanHudson's qxltools is the best option. There is afront­end called wqxt2, but it is only pre­compiledbinary for Windows.

Qxltool will format new QXL.WIN files using thecommand:

qxltool ­w test.win 2 TESTThis will create a 2 Meg QXL.WIN file calledtest.win with the QDOS label of TEST.

Qxltool also has an interactive mode that willaccept a number of commands to manage theQXL.WIN file. You can copy files from theQXL.WIN file to DOS, from DOS to QXL.WIN,create directories, list files, etc. Qxltool is about theonly way to get files from DOS to QPC1, withoutusing another emulator.

qxltool for DOS will need to have a copycwsdpmi.dll. This can be found via a Googlesearch and just needs to be put in the same directoryas qxltool.

Astronomical Algorithms on the QL

In high school, when I was planning for college, Ithought I would get a degree in Astronomy. One ofthe first things I bought with the funds from myfirst job was a 6­inch Newtonian telescope. I hadeven join the Astronomy Book of the Month club.Despite getting a degree in Computer Science, Ihave always been interested in Astronomy.

I've been interested in algorithms that are used forcalculating things astronomical. The key book forthis is "Astronomical Formulae for Calculators",fourth edition, by Jean Meeus. The first edition waspublished in 1982 and the fourth in 1988. Thefollow on book is "Astronomical Algorithms" byJean Meeus. I have both books and found the firstbook to be smaller, cheaper and has most of thesame details as the second.

The code for each routine is written as closely tothe algorithm/calculation in the book. The samevariable names are used so that it is easy to read thebook and follow exactly what the code is doing.The code examples are in SuperBasic (.bas) andStructured SuperBasic (.ssb).

Gregorian Date to Julian Date

A Julian Date is the number of days since January1, 4713 BC. Julian dates are used in Astronomicalcalculation because it does not have to worry aboutyears, months or days. A Gregorian Date is the day,month, year that we all currently use, from theGregorian Calendar. The program will take a day,month, and year and convert it to the Julian Date.

Julian Date to Gregorian Date

This program will take the Julian Date and convertit to a Gregorian Date. Since most of us think inday, month, year, and astronomical calculations areeasier done in Julian Date, these two routines areneeded for the other programs.

Page 7: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 5

Date of Easter

The date of Easter has been important to theCatholic Church for almost two thousand years.The date of Easter is defined as "the Sundayfollowing the full moon that follows the northernspring equinox."

Day of Week

Another importantcalculation is theday of the weekwhen given aGregorian date. Ifyou want to knowwhat day of theweek you wereborn, this programcan calculate that.

Phase of Moon

The moon is the largest celestial object in the sky.Everyone sees it, but do they really see it. Howmany know what the current phase it? Thisprogram will give one of four phases of the moonfor any given date. The calculation is based on thefact that the lunar cycle is 29.53058868 days. Witha known full moon date, determining the number ofdays from that date to the given date, and thendividing by 29.53058868 days, quickly determinesthe phase.

Dates of Solstices and Equinox's

A Solstice is the greatest north or south distancethat the Sun will progress. It happens in the

Summer and Winter. An Equinox is when the Sunis directly above the equator. This happens in theSpring and Fall. The start of each season is basedon either a solstice or equinox. This program willdetermine the day of each solstice and equinox.

Positions of Jupiter Moons

The Galilean moons of Jupiter are the 4 that Galileodiscovered in 1610, Io, Europa, Ganymede, andCallisto. Using telescope or binoculars, it is fairlyeasy to make out the 4 moons orbiting aroundJupiter. Because they are fairly easy to see withlow power optics, they are a common set of objectsfor beginning stargazers to observe. The moonorbit Jupiter fast enough that the positions changepretty much nightly. This program will calculatethe positions of the moons, in relation to Jupiter, onany given date.

Computer Graphics with Pascal

When I graduated from college, Pascal was theprimary language that was used for most of theclasses. Since I've been tinkering with theComputer One Pascal compiler, I started thinkingabout the books that I kept from college.

One of the last classes that I took on college wasComputer Graphics. The primary book we usedwas "Computer Graphcs" by Hearn & Baker. Twoof the first algorithms that the book discussed wasthe line and circle algorithm.

define function greg2jd(year, month, day)local jd, a, b

if month = 1 or month = 2 thenyear = year ­ 1month = month + 12

end if

a = int(year/100)b = 2 ­ a + int(a/4)jd =int(365.25*(year+4716))+int(30.6001*(month+1))+day+b­1524.5

return jdend define

Page 8: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 6

The first primitive for computer graphics is thepoint (or pixel). There is no algorithm to plot apixel on the screen, as it is sort of a given. With thepoint defined, the next algorithm is creating a line,based on drawing a number of pixels.

The most famous algorithm for the line isBresenham's. It candraw a line from anytwo points, to anyother two points. Itcan handle forwardand reverse lines, withpositive or negativeslopes. It is also analgorithm that usesinteger math and inthe main part of the

routine, the math calculations are just simpleaddition. It draws the line from point (x,y) toanother point (a,b). If the two end points areswitched around, then the drawing goes theopposite way.

I typed in the procedure directly from the text bookand the only change I had to make was to substitutethe function set_pixel with an more QL specificone. With just that one minor change, the procedurecompiled just fine with Computer One Pascal. Ifcourse, I could have just wrote another routinecalled set_pixel and had it map to the right QLcommand and that would have made the procedurecompile with no changes.

The next primitive is a circle. The algorithm uses amodification of the Bresenham line algorithm todraw the circle ina slope­likemanner. The mostobvious method toplot a circle mightbe to draw a circleusingtrigonometricfunctions.Another might beto use Pythagorastriangle theorem to draw all of the points. Theproblem with both of these methods is that they arecomputationally heavy. In the early days of

computers, they would have taken too long to drawa circle. My using Bresenham's algorithm as astart, the concept that was used for lines was usedfor cicles.

The procedure from the book compiled with nochanges, except for the set_pixel function, which Ihad changed as in the line program.

QL Benchmarks

I have three emulators running on my laptop. Q­Emulator and QPCII are running via Wine, andSMSQmulator is running natively under Java. Iwas curious to know which one of the emulatorswere the fastest. Speed is not a critical issue forme, but I was just curious which one of theemulators did have the highest speed. Since allthree emulators were running on the samehardware, this takes any CPU speed issues out ofthe equation. To get the benchmark programs, Iwent to Dilwyn's side and found some there.

Bogomips

The first benchmark I ran was Bogomips 1.5, byThierry Godefroy. Bogomips was designed for theLinux kernel and this version uses the same code asthe kernel. With this benchmark the higher thenumber the better. In this test QPCII came out ontop, then Q­Emulator and SMSQmulator.

Dhrystone

Dhrystone is a benchmark that only uses integermath. The tests that I ran had it go through it's loopfor 1 million iterations. The result of the test is ameasure of the system in MIPS. QPCII came outwith 47.509 MIPS, Q­Emualtor with 37.44 MIPSand SMSQmulator with 22.77 MIPS.

QSBB

QLAY Superbasic benchmark run a number ofroutines to test different features of SuperBasic. Itcovers Print, String, and Functions.

This was the only test in which SMSQmulator beatout Q­Emulator

Page 9: smsqzine - Sinclair QL · directory. Find the EMX, XMS and UMB section of the file and set the following: xms=false ems=false umb=false Setting up DosBox DosBox can read the underlying

Page 7

I knew going into this that SMSQmulator would notbe the fastest emulator, given that Java virtualmachine is not known for being a speed demon. It

was interesting to see the QPCII cameout on top of Q­emulator. IIRC,QPCII is written mostly in Assembly,so that would produce faster code.

To make the output more interesting, Iused Easel to produce the charts. It'sbeen quite a while since I had usedEasel and it took a while to get backinto how it works.

Editorial

So, why is the editorial at the end ofthe magazine? Because I started thelayout before remembering theeditorial.

All of the feedback that I got from thelast issue was all positive. I hope thesame goes for this issue. The mix ofthe history, usage and programmingarticles should provide a littlesomething for everyone. I'm alwayslooking for ideas for articles. Eachone of us has a different interest andskill level with the QL. What I mightthink is common knowledge, might beconsidered arcane to someone else.

I'll keep this short and get this issueout before September ends.

QPC2 Q­Emulator SMSQmulatorPrint 174,660 39,080 121,780Function 712,340 148,580 162,340Strings 1,010,100 196,840 418,900


Recommended