Books that you just can't quit.
Much as parts of the presentation,writing style infurates me, there is a book I just keep comming back to again and again.
Its like the Yang to the Yin of the Tim Hartnell writing style.
Advanced Graphics With The Sinclair ZX Spectrum, Why can't I quit you!:x
Much as I hate this book its full of great advice and tips.
lol.
:D



Its like the Yang to the Yin of the Tim Hartnell writing style.
Advanced Graphics With The Sinclair ZX Spectrum, Why can't I quit you!:x
Much as I hate this book its full of great advice and tips.
lol.
:D



Post edited by wibble on
Comments
Bytes:Chuntey - Spectrum tech blog.
As can be deduced from the numbers, none of these listings would have yet been encountered by the reader and are scattered widely throughout the book, and what initially appeared as a simple task to start with is revealed to be a substantial typing ordeal. Hardly the best of introductions to the topic. There's a lot of useful stuff in the book, but the presentation is poor.
By far my most read Spectrum book is the Logan/O'Hara "The Complete Spectrum ROM Disassembly". I've referred to that frequently for 30 years. Flipping Hell! I'm surprised that it's still in one piece, although some of the pages are just hanging on by a thread.
That little gem when I read it the first time caused much grief. I think it was a joke to keep "the wrong sort" from reading the book. Its so weird why you would put that at the very begining of the book unless it was delebrate to scare people off or try and diffrentiate it from the other type in books.
I can imagine many people put the book on a shelf and never opened it again after that fiasco.
You could hear my curseing from the first floor when I found out the typein had a bunch of additional modules to merge. Once I calmed down, the following examples were pretty self contained (for the first party anyway..)
The maths as you say is clever, but thats another problem I have with its writing style. the maths is just magic. very little explanation. So its like the start of a whole bunch of research.
Very strange book, looking at Infoseek, the reviews state it was a bunch of accademics that wrote it. So I guess thats what lead the the bizare document planning.
Also they appear to be "language purists" you notice how they hit you with modular programming right at the start.
Shame with a lot of the orignal books the binding seems to go (I am thinking of the melborne house books - the spines seem to disintegrate.) I am thankfull majority of the books have been scanned now so I can put them on a tablet.
hopefully 30 hours basic will get scanned (the zx version) at some point. I can remember I used that when I was a nipper (but alas I have forgotten much of it lol.)
My newbei coding skills cant find why its not working quite as the listing should. When I run the program sometimes snake blocks get left in the play area.
Snake on the spectrum. :lol:
Here is a question, the controls seem to be quite unresponsive, is that because of the limitations of basic or would a machine code routine for scanning the keyboard have the same problems?
Ok 'tip of the hat to the authors that writing the code like this makes it easyer to swap out/play with the parts of the program.
Alternatly I might just be getting old and my reactions are bad. :lol:
This is the first "real" program that uses the merged modules, I cheated and used a text editior to create the BAS files but I guess pureists would use MERGE.
Ok, not the most visualy impressive but the concept is quite revolutionary for a specky program I cannot remember it being mentioned before about modular programming. I know as a kid at the time it would have blown my mind lol.
(all subroutines are included in the listing to avoid heartache and disapair.):-P
N = 2
N = 3
N = 4
N = 5
N = 6
N = 7
N = 8
N = 9
N = 10
N = 11
N = 12
N = 13
N = 20
100 REM main program/ calling polygon 109 REM setup identifiers to graphics routines. 110 LET start = 9700:LET setorigin = 9600: LET moveto = 9500: LET lineto = 9400 120 LET HORIZ = 3: LET VERT = 2.1 130 GO SUB start 140 LET XMOVE = HORIZ*0.5: LET YMOVE = VERT*0.5 150 GO SUB setorigin 160 DIM X(30): DIM Y(30) 169 REM setup vertices of regular N-gon in arrays X and Y. 170 INPUT "TYPE VALUE OF N ";N 180 LET ALPHA = 0: LET ADIF = 2*PI/N 190 FOR I = 1 TO N 200 LET X(I) = COS ALPHA: LET Y(I) = SIN ALPHA 210 LET ALPHA = ALPHA + ADIF 220 NEXT I 229 REM join point I to point J : 1<=I<J<=N. 230 FOR I = 1 TO N-1 240 FOR J = I+1 TO N 250 LET XPT = X(I): LET YPT = Y(I): GO SUB moveto 260 LET XPT = X(J): LET YPT = Y(J): GO SUB lineto 270 NEXT J 280 NEXT I 290 STOP 300 REM polygon 301 REM IN :NPOL, X(), Y() 310 LET XPT = X(NPOL): LET YPT = Y(NPOL): GO SUB moveto 319 REM join vertices of polygon in order. 320 FOR I = 1 TO NPOL 330 LET XPT = X(I): LET YPT = Y(I): GO SUB lineto 340 NEXT I 350 RETURN 9400 REM lineto 9401 REM IN : XPT, YPT, XPEN, YPEN 9402 REM OUT : XPEN, YPEN 9410 LET NXPEN = FN X(XPT) 9420 LET NYPEN = FN Y(YPT) 9430 PLOT XPEN,YPEN 9440 DRAW NXPEN-XPEN,NYPEN-YPEN 9450 LET XPEN = NXPEN: LET YPEN = NYPEN 9460 RETURN 9500 REM moveto 9501 REM IN : XPT, YPT 9502 REM OUT : XPEN, YPEN 9510 LET XPEN = FN X(XPT) 9520 LET YPEN = FN Y(YPT) 9530 RETURN 9600 REM setorigin 9601 REM IN : XORIG, YORIG, XMOVE, YMOVE 9602 REM OUT : XORIG, YORIG, XPEN, YPEN 9610 LET XORIG = XORIG + XMOVE: LET YORIG = YORIG + YMOVE 9620 LET XPEN = FN X(0) 9630 LET YPEN = FN Y(0) 9640 RETURN 9650 DEF FN X(Z) = INT ((XORIG + Z)*XYSCALE + 0.5) 9660 DEF FN Y(Z) = INT ((YORIG + Z)*XYSCALE + 0.5) 9700 REM start 9701 REM IN : HORIZ, VERT 9702 REM OUT : NXPIX, NYPIX, XORIG, YORIG, XYSCALE, XPEN, YPEN 9710 LET XORIG = 0: LET YORIG = 0 9720 LET XPEN = 0: LET YPEN = 0 9725 REM PAPER COLPAP:INK COLINK 9730 LET NXPIX = 256: LET NYPIX = 176 9740 LET XYSCALE = NXPIX/HORIZ: LET YSCALE = NYPIX/VERT 9750 IF XYSCALE > YSCALE THEN LET XYSCALE = YSCALE 9760 RETURN 9800 REM plot / CalComp 9801 REM IN : XPT, YPT, XPEN, YPEN, XORIG, YORIG, MODE 2802 REM OUT : XPEN, YPEN, XORIG, YORIG 9810 LET NXPEN = FN X(XPT) 9820 LET NYPEN = FN Y(YPT) 9830 IF ABS (MODE) = 2 THEN PLOT XPEN,YPEN: DRAW NXPEN-XPEN,NYPEN-YPEN 9840 LET XPEN = NXPEN: LET YPEN = NYPEN 9850 IF MODE < 0 THEN LET XORIG = XORIG + XPT: LET YORIG = YORIG + YPT 9860 RETURNHowever, as 'key' is only called once there's not much point putting it in a sub-routine anyway. The same applies to 'worm'.
It takes time to pass over a REM (7 frames according to BASin), so don't put them in places where the interpreter will have to pass over them many times.
Turn off CAPS with POKE 23658,0 at the start so line 4020 can be dropped.
Avoid checking things more than once whenever possible. Avoid checking things at all whenever possible (eg. A$=""). Use literal numbers for GOTOs/GOSUBs rather than variables if the line number is not calculated and the routine is time-critical. Use multi-statement lines where possible.
Running lines 1110-1118 100 times for each of the four conditions being true in turn takes 9.9 secs according to BASin, whereas doing the same for lines 4000-4060 takes 15.2 secs.
However I did MERGE now that the tap file is available (only for the first few programs though), and it's a lot better than flipping pages all the time.
And if I see the end results I'd just wonder why it needed so many libraries all around the book in the first place...
Games List 2016 - Games List 2015 - Games List 2014
Thanks I will give that a spin tommorow,
Just a quick question. Another program I have accepts
What I want to do is convert the string B$ into either all upper case or all lower case letters so when I do a comparison against some data statements I dont have to have repeated sets. like "The Kings Head", "THE KINGS HEAD", "the kings head".
How can I do this?
I tryed just using the 4020 statement but it seems not to work.
hmmm... but I like to think on other projects to keep fresh.
Am chuffed I actually entered a assembly command into the spectrum, understood why and didnt just blindly rote copy functions. Horray!
:p ok it was only C9 :Dbut still its a start, journey of a 1000 miles starts with a first step and all that jazz. Its a great feeling when stuff goes right.
I'd change Battle Bunny's code to use CODE("A") instead of 32 but then again I prefer clarity to speed ;)
Ah my mistake, yes machine code.
Ahhh how happy life is when you are easly pleased. :D
When i was about 9 or 10 (late 80's/early 90's) i borrowed a book which had a ton of fun projects for the ZX 48K. I remember that one of the projects was to code a 3D (ish) sphere which (if i remember correctly) flashed colours? I think (may be wrong) that the book was a black coloured paperback. I spent hours and hours a night on that book but when i moved to the + model then +3 i pretty much forgot all about it with the excitement of using floppy discs. By any chance does anyone recognise the book? I would love a copy to show my young son what i was capable of with my 48K back when i was his age!
Thanks
Thanks for the reply! I remember this book, sadly, it was a bit of a dodgy effort and as I recall the tape got slung into the bottom of my drawer. Thanks for trying though! I had a fair few books, I will carry on looking. This bloody sphere was pretty basic to be fair, I was only about 9 and living in a world where Acorn and BBC were the top names at school haha. I will admit I eventually moved over to Atari ST and Amiga, my best creation being an Ikari Warriors type game haha.
Thanks for trying!