04.03.2013 Views

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overall then, it would seem<br />

that the text facilities of LSDare<br />

pretty powerful. You can put<br />

text wherever you want it to<br />

the exact pixel — you can print it<br />

any size you want, and in a large<br />

variety of typefaces (twelve in<br />

total!. You can escape from text<br />

mode by pressing CAPS<br />

SHIFT-SPACE or ENTER. You<br />

can re-enter text mode by press<br />

ing key P, or return to BASIC by<br />

jressing SPACE.<br />

The Light Screen Designer<br />

series is now very nearly complete.<br />

The next issue will contain<br />

the penultimate episode, which<br />

will be all about draw ing ellipses.<br />

The final part part eleven —<br />

will doall the colouring in. I know<br />

a lot of people have been waiting<br />

for that facility. After part eleven<br />

there w ill be an Epilogue (I prefer<br />

to call it an Epilogue rather than a<br />

Part Twelve because the program<br />

will be completed in Part<br />

Eleven). This will be just to round<br />

everything off nicely I'll leave<br />

you now to feed in all this<br />

machine code. Bye bye till next<br />

time.<br />

ToniBaker<br />

FWE5T TXLOOP_4 U> c,(F_ruo) Bit 0 of Cs» OVER statu*.<br />

71<br />

LD A,(HL)<br />

07 RLCA Bit 0 of Ai» current pixel fron screen.<br />

11 AND C Bit 0 of A:« O if 0VI® Oj or current<br />

CB19 Jtn c<br />

pixel fiwi screen if OVEP 1.<br />

CB19 RR C Bit 0 of Ce INVERSE status.<br />

A9 ton c If DIVERSE I; then complement<br />

bit 0 of A.<br />

U XOR D Bit O of As: current pixel from<br />

required pixel-layout, with OVER and<br />

INVERSE correctly Implemented.<br />

IP AAA Carry:* pixel to print.<br />

CBlfc HL (HI) Bit 0 of (HL): correctly uteres pixel.<br />

RI POP AF A)t nunfcer of renairing pixels in<br />

5D DEC A<br />

(HL) to consider.<br />

CCFIIU) CALL Z.E^.TJXJLOUR If ell 8 bits of (HL) hsre been deialt<br />

«ith then colour the attribute byte<br />

end point HL to n«t fcyte freei screen.<br />

ri POSH AF Stack acreerv-byte pixel counter.<br />

10E9 0.1*2 TO03PJ Djpllcate pixel >3 nany tinea as<br />

is required.<br />

n FOP AP Ala aereen-byte pixel counter.<br />

Cl POP BC Bt. nunber of tUiea esch pixel mist<br />

10<br />

DEC K<br />

be duplicated.<br />

?0E0 JR KI,TIUX)P_5 Repeat thia proceedur* for all rlxels<br />

rax cp oe<br />

within current pixel-layout row.<br />

2BCC JR Z,TXALLI0H4 Juirp if HL points to a rrw byte.<br />

CB06 TIALLICBJ RLC (HL) This loop re-alligna (HL)<br />

JD DEC A so th.*'. all pixels are back In<br />

aore JH WZ,mLLIOi5 the right place.<br />

CD64EJ CALL £»4,T_C0L0(ffi Colour in the lsat attribute.<br />

EL TIALLIGM POP HL ML; points to fir*t acreen byte<br />

affected in current row.<br />

Dl POP DE DE: points to current row of<br />

pixel-layout.<br />

Cl rop BC Bi- current row nunber.<br />

Ct- coluim number of first pixel<br />

affected in current row.<br />

CDJS00 CALL DD»,DON_P;I hint HL and B one pixel down.<br />

DDCB004S BIT C, (J_PLAGS)<br />

260D JR Z,TIP_J Jupp unless printing in italics.<br />

DDCKXME BIT 1, (J_FLA6S)<br />

2004 JR K2,TIP_? Junp If using full slope.<br />

DECB0066 BIT 4,(J_FUSS) Test OEO/ETO. ROM flag.<br />

C41JDD TTEPJ? CALL K2,K>lJ,LEPT_pnt If reqd, point HL and C one plx left.<br />

ranzD TIP} DEC (BJU6Q)<br />

;>oac JR *Z,TXLOOP_2 Repeat current pixel-layout row<br />

as many tines as Is required.<br />

U DIC DE DE: points to next pixel-layout row.<br />

06 N AF,AF'<br />

JD DEC A<br />

2060 JH BZ.TILOOPJ Repeat proceedure for all rows<br />

C9 SET<br />

of pixel-layout.<br />

ZX CRAPHICS<br />

n<br />

C)<br />

D5<br />

ORO U14<br />

TJ_CTJSTSOR PUSH AP<br />

PUSH BC<br />

PUSH DE<br />

E5 PUSH HL Stack .ill registers.<br />

E5 PUSH HL Stack HL again.<br />

2A905C LD HL, (KA5K_T)<br />

EJ EI (3P),HL Stack nyjtfff enrlables<br />

P_FLAG, HL now restored.<br />

And<br />

£5<br />

PUSH HL<br />

21FPOI u> HL.oirr<br />

22905C LD (KA.;K_T),HL Set DIK flj PAPEJi 8; BRIGHT 8f<br />

El POP HL<br />

FLASH OVES 1 i HVDtSE 0.<br />

11C5EJ Lfl DE,TC_pmL P^int DE to pixel layout for cursor.<br />

CD?lt) CALL EJ91,TJ_PR»r Print the cursor onto the screen.<br />

El POP HI<br />

22905C ID (M*I-j;_r),HL Restore original colours.<br />

El POP HL<br />

Dt POP DE<br />

Cl FOP BC<br />

PI POP AP<br />

C9 RET<br />

5AOJE3<br />

OK S4M<br />

LD A,(WIDTH) '.:- width cf character Or squares).<br />

05 PUSH OE<br />

ID E,A<br />

5F<br />

87<br />

ADD A,A<br />

87 ADD A,A<br />

67 ADD A,A Ai. E-(KIDRH)<br />

DSCB0056 PIT ?,(J_P1A3S)<br />

2801 JR Z,GET_HID_^1 Jitnf unle-- 'is'rg T -Ht tyr*rf'ce.<br />

9) SUB E In which case A:» Te(uiDTH).<br />

Dl aET_wn>_i POP DE<br />

09 RET<br />

ORG F44^<br />

D5 7C_RI0HT PUSH DE<br />

CDJ4E4 C/1L E4M,OE7_WIDTH<br />

5F LD E,A £:• character width Ln pixels.<br />

67 ADD A,A tb twice this width.<br />

61 ADD A,C<br />

J80? JS C,TCR_1 Jump if cursor right no\ possible.<br />

9i SUB I<br />

4F LD C,A C:« new colurtr. r.unfaer of cursor.<br />

D1 TCR_) POP DE<br />

182C JR J_PI*AD0R<br />

D5 ?C_LEF7 tUSH DE<br />

CD34L4 'CALL C454,OET_UIDTt(<br />

5F LD E,A EIw character width in pixels.<br />

79 LD A,C A:» current cursor eolum nunber.<br />

95 SUB E A !• new cursor colum rattier.<br />

D1 POP DE<br />

D6 RET C Return If cursor left not possible.<br />

4F LD C,A C £- new colunn r.u-iber af cursor.<br />

1620 JR J_PUADLfi<br />

D5 TC_D&KN PUSH EC<br />

5A01EJ LD A,(HEIGHT) Ai* character height tn iqur*!,<br />

87 KK A,A<br />

67 ADD A,A<br />

67 ALD A,A<br />

5 T LD E,A E:« character height In nlxel*.<br />

67 ADS A,A 1:» twice this height.<br />

60 ADD A,B<br />

FEBO CP BO<br />

yxe JR *C,TCD_t Jiup if cursor dowr not cceslble.<br />

9) SUB E<br />

47 LO B,A B:» new row number of cursor.<br />

D1 TCD_1 POP DE<br />

180D JR J_FDUDIR<br />

46 ZX COMPUTING DECEMBER/JANUARY 1985

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!