home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
ST_NEWS
/
STN_02_6.MSA
/
DATA_DOC27
< prev
next >
Wrap
Text File
|
1987-09-11
|
5KB
|
2 lines
üIMPROVINGוFAאASICסROGRAMSÇbyפoberזeessels¿STIKE-a-LIGHTצoftware)In⇧⌠his⇧βrticle⇧ח≈ill⌠ell∙ou≤ome⇧∩f⇧ϕy⇧σxperience⇧βbout improving⇧⌠he≡rograms∙ou≈riteΘnוfAΓasic.⇧אut⇧≤peaking⇧∩f improvingח≈ouldµirst∮ike⌠oπongratulate⌠heϕakers∩f üSTמEWSÇ whoδeepΘmproving⌠heirϕagazineσvery⌠ime.In⇧ϕy⇧βrticle∙ouπould≥eadΘnצTמEWSØ.5¿RCS⇧הILES⇧חN⇧וfA BASIC)ח⌠old∙ouΦow∙ouπould⌡se≥esourceµiles.⇧רsing⌠hemΘs aτood≈ay⌠oϕake∙our≡rograms∮ook≡rofessional.⇧IJll⌠he≤pace thatΘs∈eededΓyΓuttons,⇧Θnputs,⇧σtc.πanΓe≈ell≤haped⌡sing resourceµiles.But⇧≈hat⇧βbout⌠he≤pace∩n⌠he≤creen⌠hatΘs∈ot⇧∩ccupied⇧Γy buttons⇧βnd⇧Θnputs?⇧תhat⇧βbout⌠heΘnformation⇧≤hown⇧∩n⇧⌠he screen,⌠he∩utput⌠o⌠he⌡ser?תhatβbout⌠he∈ame∩f⌠he≡rogramand⌠he≡rogrammer≈hen⌠heyβre≤hown∩n⌠he≤creen?⇧תhat⇧βbout help≡ages?Usingµunctions∮ikeקEXT,⇧כINE,⇧בIRCLE,⇧פBOX,σtc.πanΘmprove your≡rogram,Γut⌠hereΘsβnother≈ay.You⇧πan⌡seβΣrawing≡rogram∮ikeגEGASדLITE⌠o⇧ϕake⇧≡ictures which⇧πan⇧πheer⇧⌡p∙our≡rogram.⇧קhese≡ictures⇧πan⇧Γe⇧µull screens⇧βs⇧≈ellβs≡arts∩f⌠he≤creen¿blocks).⇧ךou⇧πan⇧Σraw whatever⇧∙ou⇧∮ike⇧⌡singβll⌠he∈ice⇧µunctions⇧∩f⇧β⇧Σrawing program,βnd⌠hen⌡se⌠he≡ictureµilesµrom≈ithin∙our≡rogram.AllΣrawing≡rograms≤ave⌠heir≡icturesΘnΣifferentµormats.⇧חn this⇧βrticleח≈illβssume∙ou⌡seגEGAS∩rגEGASדLITE.⇧חf⇧∙ou have⇧βnotherΣrawing≡rogram∙ouπan⌡se≡rograms⇧∮ike⇧סICWORKS 2.0¿madeΓy⌡s)⌠oπonvert∙our≡ictures⌠oגEGASµiles.First∙ou'llΦave⌠oδnowΦowβגEGAS≡ictureµileΘsπonstructed. Youϕust⌡se⌠he⌡ncompressedµiles:¬.PI1¬.PI2¬.PI3.SuchβµileΘsø2034Γytes∮ong.IJ≤creen¿in⌠heπomputer)Θs,∈o matter⇧≈hat≥esolution,⇧ø2000Γytes∩fΘnformation.⇧קhis⇧ϕeans that⌠heµileπontainsø4Γytes∩fΘnformation,⌠hatΘs:õ7≈ords.The⇩µirst⇧≈ord⇧¿2⇧Γytes)⇧∩f⇧⌠he⇧µile⇧Θs⇧⌠he⇩≥esolution information.Thenµollowõ6≈ords≈hichβre⌠heπolourΘnformation.Thenµollowø2000Γytes≈hichβre⌠he≤creenΘnformation.You≈on't∈eed⌠heµirst≈ord,⇧≤oβll⌠hereΘs∮eftΘs⌠heπolour information,βnd⌠he≤creenΘnformation.עuite≤imple,Θsn'tΘt?As⇧ח⇧⌠old∙ouβ≤creenΘn⌠heϕemory∩f⌠heצT⇧Θs⇧ø2000⇧Γytes long.צuchβ≤creenπanΓe∮aid∩nσveryϕemory∮ocation∙ou∮ike.In⇧µact⇧⌠here⇧βreβlwaysØ≤creens.⇧נne≤creen⇧∩n⇧≈hich⇧⌠he computerΣoes⌠hings∮ike≡rinting,⇧Σrawing∮ines,⇧σtc.,⇧βnd∩n the∩ther≤creenΣoes∈othingπhange.⇧קhatΘs⌠he≤creen⌠he⌡ser is∮ookingβt.The⇧µirst⇧≤creenΘsπalled⌠he∮ogical⇧≤creen,⇧⌠he⇧≤econd⇧Θs called⌠he≡hysical≤creen.⇧חnϕostπases⌠he⌠wo≤creensβre⇧∩n the≤ameϕemory∮ocation,≤o∙ou≈ill≤eeβllπhangesΦappen.If∙ou≈ant⌠o≡ut≤omething∩n⌠he≤creen,Γut∙ouΣon't≈ant⌠he user⇧⌠o⇧≤ee⇧Θt¿yet),⇧⌠hen∙ouϕust∮ay⇧⌠he⇧⌠wo⇧≤creens⇧∩n different⇧ϕemory⇧∮ocations.⇧ךouπan,⇧µorσxample⇧ϕake⇧≤mooth animationΓyΓuilding∙our≡icture∩n⌠he∮ogical≤creen,βnd⌠hen change⌠he⌠wo≤creens,σtc.You⇧πan⇧πhange⇧⌠he⇧⌠wo≤creen⇧∮ocations⇧⌡sing⇧⌠he⇧ןBIOS⇧Œ function:⇧שoidןbios(5,L:logic%,l:physic%,-1)Before⇧∙ou⇧πhange⌠he≤creen∮ocations∙ou'llΦave⌠o⇧µree⇧⌠he memory,∩therwiseΓasic≈ill≤crew⌡p⌠he≤creenπontents.ךouπan do⌠hisΓy:⇧פeserveõ00000The⇧∈umberΘndicatesΦowϕuchϕemory⌠here≈illΓe∮eft⇧µor⇧⌠he programβndΦis÷ariables.⇧חf∙ou≈antϕore∩r∮essϕemory⇧µree, that'sנK,Γutõ00000Γytes≈illΓe±uite≥ightµorϕost≡urposes.Now⇧∙ou've⇧Σone⌠his∙ouπanβsk⌠heπomputer⇧βt⇧≈hich⇧ϕemory location⌠heϕemoryΘsµreeµor∙ou⌠o⌡se.ךouΣo⌠hisΓy:⇧לemorytop%=HimemIn⇧ϕost⇧צT⇧πomputers⌠heלemorytop%⇧÷ariable⇧≈ill⇧Γe⇧βround &H47000.⇧חt⇧Θs≈ise⌠o∮ay∙our≤creens∩nlyβt⇧∮ocations⇧∮ike &H48000,ªH50000,ªH58000,ªH60000,ªH68000,σtc.By⌠he≈ay,⌠heϕemory∩f∙ourπomputersσndsβtªH80000¿1/2ϕeg) orªH100000¿1ϕeg).The≤tart∩f∙our≡rogram≤hould∈ow∮ook∮ike⌠his:⇧פeserveõ00000♪íµreeϕemory⇧שoidןbios(5,L:&H78000,l:&H78000,-1)⇧í≤et≤creensβtªH78000⇧בls
íπlear≤creenNow⇧≈e⇧πan⇧∮oadβגEGASדLITE≡icture⇧µile⇧Θnto⇧⌠he⇧ϕemory. Because⌠he≤creen∮ocationΘsβtªH78000≈e≈ill∮oad⌠he≡icture atªH70000.⇧קhe≤teps∩fªH8000βreΘnµactø2768Γytes∮ong,⇧≤o thereΘsσnoughϕemoryΓetween⌠he∮ocations⌠o∮eave⌠heσxtraø4 bytes∩f⌠he≡ictureµile.תe≈ill∮oad⌠he≡ictureβtªH70000-34, so⇧⌠he≤creenΘnformation≈illΘmmediatelyΓeβt⌠he∮ocation⇧∩f &H70000.⇧אloadóA:\PICTURE.PI1",&H70000-34Now⇧≈e⇧πan't≤ee⌠he≡icture,⇧ΓecauseΘtΘs∈ot∩n⇧⌠he⇧≤creen memory.⇧תe≈ill∈owϕove⌠o≡ictureΘnformation⌠o⌠he≤creen.גo thisΓy:⇧אmoveªH70000,&H78000,32000íϕoveø2000ΓytesªH70000®ªH78000 Now⇧⌠he⇧≡ictureΘs∩n⌠he≤creen.⇧קada!!!⇧אut⇧≈ait⇧«..⇧תhat happened⇧⌠o⇧⌠heπolours?⇧תeΣidn't⌠ell⌠he⇧πomputer⇧βnything about⌠heπolours,⇧≤oΦeΣidn'tπhange⌠hem.⇧עuite∮ogical.⇧אut howΣo≈e⌠he⌠heπomputer⌠o≤how⌠he≥ightπolours:⇧שoidןbios(6,L:&H70000-32)⇧íτetπoloursβtªH70000-32Remember⌠heπolours≈ere≥ightΓefore⌠he≤creenΘnformation,⇧≤o at⇧ªH70000-32.⇧ןbiosÀΘs⌡sed⌠oτet⌠heπoloursβt⇧β⇧πertain location.Byσxperimenting≈ith⌠his≤tuff∙ouϕustΓeβble⌠o⌡se⇧≡ictures from≈ithin∙our≡rogram.If⇧∙ouΦaveβny±uestions∙ou're≈elcome⌠o≈rite⌠oϕe.⇧ח⇧≈ill answer⌠hemΘfחπan.I⇧≈ish∙ouβ≤uccessfulβndΩoyfulΩourney⌠hrough⌠he⇧Φazardous bits∩f∙ourδompjoeter.Oh∙es,ϕyβddress:STRIKE-a-LIGHT≤oftwareT.a.v.פobertזeesselsGroteאergÕ55611יJ⇧דindhovenTheמetherlands