DSKTOOL p SY26V#61y}T(MSXDOS SYS[BI MSXDSKIOINC[BLPAL INC[BSPLAYER INC[BX6SPRITE INC[BfFILL2 type caracter = array[1..8] of byte; sprite1 = caracter; sprite2 = array[1..32] of byte; var a: byte; hl,bc,de: integer; keybuf:array[1..11] of byte; Procedure ClPrim(ix:integer); begin InLine($F3/ $3A/A/ $2A/HL/ $ED/$4B/BC/ $ED/$5B/DE/ $DD/$2A/IX/ $CD/*+18/ $32/A/ $22/HL/ $ED/$43/BC/ $ED/$53/DE/ $FB/ $C9/ $08/ $DB/$A8/ $F5/ $E6/$F0/ $ED/$73/$9A/$F3/ $C3/$F38C ) end; type LinhaBas = string[255]; var Handler: string[7]; Procedure InstHook (x:integer); begin Mem[x]:=$C3; Mem[x+1]:=Lo(Addr(Handler)); Mem[x+2]:=Hi(Addr(Handler)); end; Procedure Basic(x:LinhaBas); begin x:=x+#0; InLine($21/x/$22/HL); ClPrim($4187); end; Procedure InstallBasic; begin Handler:=#$ED+#$7B+#$9A+#$F3+#$C3+#$92+#$F3; InstHook($FF02); InstHook($FFB1); InstHook($FEF8); end;  '*.25=@HVY]besv !&+.14:ENSVYbeknvy  *-58;CFIP\c "03=ADGNQX]eux"%(?Vcjm!$';>Qfpsvy !'*-69<FKORWZ]`cfknqt{~ !$',25:=@CFJMPX]`ip|      ' / : > H N W [ e r u {   # , I e s v z   4 > C I W  ) L O [ g x   % - 6 X c f i o t  #-2<?BGL\mrw| ,0;NVat#-?(2!<(|  !"+"-#"!w#T!O:W!GO!^#V#z( |g~w`."('ĜO{(k ʑ 4 Gŷ1xx(1,(͔+>*y, uCu+:iB(z*?#"?:>Ļ*?:?GÑ)*:>:?U<2?>*͖#ͨy,(:>=+G2>:>= 2>:>1!"N8C~#_~#W x S:<2 !w/ / !"P"R#"=>2> 2:8 ͖AUTOEXECBAT COMMAND version 1.11 $7:?(!͖W  B(?:?”+!"&?,7, "&?x(7, ~, #"&?, "&?y121pF͊!20A{>>{*O": N> :O8 >2O>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 ?#~#(+~a8{0 :."[]_/+=;, :\<!]= \ >?#>=dMD]Q:0"PŸ́H!>-2> 2(xAÖ́*"> 2> 2>-)| >a8>p2| 0  MG̈́>.2> 2>:22!!x͡y͡z͡{͡>0!6 / 0:p#w##!x0G!x8 R0?GɷR p! y~#{:2o&& :2=>sUC6C8 )!6~'w# !9~e> O~+e(0 > {> > __DIR COPY TYPE % REN w DEL DATE TIME RENAME w ERASE PAUSE q REM VERIFY MODE BASIC PFORMAT V Insert disk with batch file and strike any key when ready $Strike a key when ready $Invalid drive specification$Bad command or file name$Program too big to fit in memory$ $ file$ bytes free$File not found$Are you sure (Y/N)? $Rename error$Invalid parameter$File cannot be copied onto itself$Content of destination lost before copy $File creation error$Write error$Insufficient disk space$ copied$Current date is $Invalid date$ Enter new date: $Current time is $Invalid time$ Enter new time: $SunMonTueWedThuFriSatCOMBATy5x5A $$DOS ?0610F' MSX-DOS version 2.2 by Tim Paterson 03/06/84[Aaterson 03/06/841! !.W_>EN !!!&#*"!*s!! Qz/}2**&+! s*&#.* !s#r*!s#r*!s#r*!s#r*!s#r*!s#r*!s*!s*!s#r*!s#r*!s#r* !s#r*"!s#r*$!s#r!:e.!% !jE0!*sC0!!n&&}2*&!AR!*s!}2!:e.!% !}2!*&n&!.͕*&!:e.!% ! }o*&!% }oE0**&+!*&n&s*&!}2*&!}2d0!.e.!% !͕Eʽ1!.e.!% !}2! }2*&!.e.!% !*&!% }oEʽ1**&+!*&n&s*&!}2*&!}2=1[2*&!jE1*"1!"* !!!&#*"!*s!! QzI2}2**&+! s*&#2* !s#r*!s#r*!s#r*!s#r*!s#r*!s#r*!s*!s*!s#r*!s#r*!s#r* !s#r*"!s#r*$!s#r!:e.!% !jEM3!*sy3!!n&&}2*&!AR!*s!}2!:e.!% !}2!*&n&!.͕*&!:e.!% ! }o*&!% }oE54**&+!*&n&s*&!}2*&!}2Ú3!.e.!% !͕E4!.e.!% !}2! }2*&!.e.!% !*&!% }oE4**&+!*&n&s*&!}2*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J!*}2J*}2!*& *&}2:G!-*!"!!% Qz`K"*!*n&s*!"*#/K*!s!!!%K!Mh!jEʡK!}2èK!}2!!!e.f !e.f !>e.f *&e.f !e.f !e.f !!e.f !e.f !e.f !e.f !e.f !se.f !e.f !e.f !e.f !e.f K!!"*!% *!}oEʣL!"M!"!% "!%!%***R!͔ "*!EM**!R"*}2}2""!*&}2*&}2*"*"*"*"*&}2p!!% QzʢM}2!*&n&}2:*!*&#kM*"*"*&}2!}2p}2}2!!%*&*&!! M}2}2}2!!%*&*&ͿM*&EDNhE-N!ͅ!g*'!!! 6!5;:!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))! s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l!))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!l! ))!s!! QzVR}2k! }2j!l*k&))!l*k&))n&*j& s!l*k&))!l*k&))n&*j& s!l*k&))!l*k&))n&*j& s!l*k&))*k&s*k&#ÏQ!}2i!}2h!! QzsS}2g!l*g&))n&!l*g&))n&ER!l*g&))n&}2f!l*g&))!l*g&))n&s!l*g&))*f&s!l*g&))n&*i&E-S!l*g&))n&}2i!l*g&))n&*h&EhS!l*g&))n&}2h*g&#oR!"b*b! EWU!}2e!l*b))n&!l*b!))n&EMT!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!EFT*b!R"b!}2e!l*b))n&!l*b!))n&jE6U!l*b))n&!l*b!))n&E6U!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E/U*b!R"b!}2e*e&!jETU*b!"byS!! QzU}2g!l*g&))n&!l*g&))n&!2!l*g&))n&!l*g&))n&!2!!͛G*g&#bU!"`*i&*h&QzV"b!! QzV}2g*b!l*g&))n&*b!l*g&))n&}oEʷV*`!jEyV!l*g&))n&"`÷V*`*b!2!l*g&))n&*b!2!!͛G!"`*g&#V*b#U8press any key to re-fill :)! !!MhEV!ͅ!_g*'*_&}2d*d&!jE[N'l*g&))n&*h&E!l*g&))n&}2h*g&#oR!"b*b! Erg!}2e!l*b))n&!l*b!))n&E!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E*b!R"b!}2e!l*b))n&!l*b!))n&jEj!l*b))n&!l*b!))n&E!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E*b!R"b!}2e*e&!jEj*b!"byS!! Qz}2g!l*g&))n&!l*g&))n&!2!l*g&))n&!l*g&))n&!2!!͛G*g&#bU!"`*i&*h&Qz"b!! Qz}2g*b!l*g&))n&*b!l*g&))n&}oE5h*`!jEj!l*g&))n&"`]V*`*b!2!l*g&))n&Û.4VxaBmsxPx5Y  LMK~7#~͘=Ͱ on7!!"~#(þ}:= +̀*~!X!R̀*j!d!^:(2!x:(>2!r!l!;:NO:L͏:OO:M͏!̀*P! !K45(!+/ 0y0( d!!+*:> = o&:(h|( 'YJ*"x2>2! '" !h! og2"">~22(:(m2l{>p>@=ɯ2og"">27'!6'"|g2~>27'2M"R>27'" !>27'ů!Sz>27'!"R>2!S|!+!>{:7'8'>M?> !E9N# y > 8O" ((6 #=!"o&>eMM>6'FH GIOS 2.1 Co&nk} [ (!1f͑A8Q0G: x@!(w# (m ?(*( .( bI. I!46# (?( *( m( w#>?> w#͑ 8 !ɿ .,;:=?*[]<>{}a{ |͟}ͨ 80ô7||}:2͚%*B' "2>2!h(""*B"[R`$*"^#V#^#V#N#FO/o&9O/o&9!9(> (G!9 w#Eͥw}88'RB0 >8'R\RR!+B  mSmmR!+ S !+ S !+ S !# S !+ ST]KB!z> S>))0 = |,< *: | C: #R8 O y(Gy=: OxGٯŇR833<)  % << Aͼ ) <z {0Gɯgo|| }||/g}/o#}o&z| }|} }o|g{_zW}o|g{_zW}o|g{_zW}/o|/g{/_z/WzMDog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nf ut"6#6%*6%*!""*NFy(* "*B0Cnf* [R*"*RS[s#r^#V""6#>>O"w2x2*"!N&"" ( (͇*"*>>2"*"!N&"""!(*:(=( ͘t;!~6go((R*s#r_2x( s x(T]DMx(R0 U(ͥ&O/o&9q# (!>F0#( ~ ( #]( ~ ( (#}(  i&T-a%U}͑o*!~6o&ɯ2+|:22}:_>_2:n("s͍z Ͱ^C User break+= Ͱ I/OͰ Run-timeͰ error {͟Ͱ, PC=*͚{8400Ͱ !(֩G(~# ̀ͰNot enough memoryͰ Program aborted MemMan not presentWrong MemMan versionGIOS-tsr not presentGIOS not presentWrong GIOS version͊(!~6{*+U+:!: 9,R_>{o}+ x?>2(ŷ(}+ ?8G?}+<:(ʷ)S/)y*"-)[}+K-)BK/) "1)ʹ* >>(8x| }(~#_(%g( K1)>. (|}>S/)!6#n*w#p#q#w#w#w#wy*"-)"1)͂*8(G#~+:x ##A8<)0>"1)1*~. #:**/)*-)*1)AR)͂*8"( ͂*(8#(*( ?(g*{_>  >?6 # ~#ͮ*(+~a8{0 8 !*ɯ .,;:=/+[]<>{} +~.(͍*(#+#~ (,+~.(\( :((*6.#w#p#q#6:+o&2+!(~ 562+2+*#"(!+"#:((*%"(!+"% *"(*+"!(~(6*("#*(:(("%"s{+y2+2++2+++2+y2+2+x2+>2+:((:+{{+:( :++,:++:+80:+:+:+O!, ~!.,:+O~#((#~&'+-2Y,CZ,:(D Z2Y,CZ,:(C D:Y,KZ,3)6}+6#ww#w#w#w:Y,KZ,3)G}+p:( `i1q#p#s#r`i GJ}+:( `i1N#F#^#V`i! GJ>}+:( `i -,"0-S2-! GJ>}+*0-[2-,:( }+ '}+  GH}+:( }+ &}+ GI}+:( `i}+ GE}+:( (> GO3)(}+M}+:( !}+GR}+:( ((> GO3)(}+(> GO3)(}+[}+N}+x)8G@>::(>\Y}+>۷y.^-È.y.͊-È.,"c.Se.*c.[e.,1! !.W_>EN !!!&#*"!*s!! Qz/}2**&+! s*&#.* !s#r*!s#r*!s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! ))!s!! QzVR}2k! }2j!l*k&))!l*k&))n&*j& s!l*k&))!l*k&))n&*j& s!l*k&))!l*k&))n&*j& s!l*k&))*k&s*k&#ÏQ!}2i!}2h!! QzsS}2g!l*g&))n&!l*g&))n&ER!l*g&))n&}2f!l*g&))!l*g&))n&s!l*g&))*f&s!l*g&))n&*i&E-S!l*g&))n&}2i!l*g&))n&*h&EhS!l*g&))n&}2h*g&#oR!"b*b! EWU!}2e!l*b))n&!l*b!))n&EMT!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!EFT*b!R"b!}2e!l*b))n&!l*b!))n&jE6U!l*b))n&!l*b!))n&E6U!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E/U*b!R"b!}2e*e&!jETU*b!"byS!! QzU}2g!l*g&))n&!l*g&))n&!2!l*g&))n&!l*g&))n&!2!!͛G*g&#bU!"`*i&*h&QzV"b!! QzV}2g*b!l*g&))n&*b!l*g&))n&}oEʷV*`!jEyV!l*g&))n&"`÷V*`*b!2!l*g&))n&*b!2!!͛G!"`*g&#V*b#U8press any key to re-fill :)! !!MhEV!ͅ!_g*'*_&}2d*d&!jE[N'l*g&))n&*h&E!l*g&))n&}2h*g&#oR!"b*b! Erg!}2e!l*b))n&!l*b!))n&E!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E*b!R"b!}2e!l*b))n&!l*b!))n&jEj!l*b))n&!l*b!))n&E!!))!l*b))!l*b))!l*b!))!l*b!))!!))*b!E*b!R"b!}2e*e&!jEj*b!"byS!! Qz}2g!l*g&))n&!l*g&))n&!2!l*g&))n&!l*g&))n&!2!!͛G*g&#bU!"`*i&*h&Qz"b!! Qz}2g*b!l*g&))n&*b!l*g&))n&}oE5h*`!jEj!l*g&))n&"`]V*`*b!2!l*g&))n&{ FILL 2 } {$i MsxDskIO.inc} {$i msx.inc } {$i pal.inc } {$i sprite.inc} {$i misc.inc} type MyPoint=record yI:byte; yF:byte; x:byte; n:byte; end; Procedure GraphicPrint(Str:TPString;X,Y:Integer;Color:Byte;LogOp:Byte); { Escreve uma string em modo grafico } Var StoreX,StoreY :Integer ; ch :Char; i,StoreColor :Byte; GRPACX :Integer Absolute $FCB7; GRPACY :Integer Absolute $FCB9; ATRBYT :Byte Absolute $F3F2; LOGOPER :Byte Absolute $f570; Begin StoreColor := ATRBYT; ATRBYT := Color; StoreX := GRPACX; StoreY := GRPACY; GRPACX := x; GRPACY := y; LOGOPER :=LogOp; For i := 1 to Length(Str) Do Begin ch := Str[i]; Inline ( $f3/ $3a/ch/ $fd/$2a/$c0/$fc { LD IY,(EXPTBL - 1 } /$DD/$21/$10/$15 { LD IX,grpprnt } /$CD/$1c/00 { CALL CALSLT } /$fb ); End; GRPACX :=StoreX; GRPACY :=StoreY; ATRBYT :=StoreColor; LOGOPER := 0; {Normal condition} End; procedure gprint(t:tpstring;x:byte;y:byte); begin graphicprint(t,x,y,15,0); end; procedure pptn ( t: tpstring; x,y:byte; k:boolean); var ch:char; begin gprint (t,x,y); if k then begin repeat until keypressed; read (kbd,ch); end; end; var MySwap: array[0..0] of MyPoint; Vertici: array [0..13] of MyPoint; x,xx:byte; var ymin,ymax,k,yy,minus,tasto :byte; var i,Xstart:integer; ch: char; begin COLOR (15,1,1) ; screen (5); repeat cLS2; vertici[1].yI:=8; vertici[1].yf:=6; vertici[1].x:=3; vertici[2].yI:=6; vertici[2].yf:=5; vertici[2].x:=2; vertici[3].yI:=5; vertici[3].yf:=6; vertici[3].x:=4; vertici[4].yI:=6; vertici[4].yf:=8; vertici[4].x:=6; vertici[5].yI:=8; vertici[5].yf:=3; vertici[5].x:=9; vertici[6].yI:=3; vertici[6].yf:=4; vertici[6].x:=6; vertici[7].yI:=4; vertici[7].yf:=5; vertici[7].x:=7; vertici[8].yI:=5; vertici[8].yf:=3; vertici[8].x:=5; vertici[9].yI:=3; vertici[9].yf:=2; vertici[9].x:=3; vertici[10].yI:=2; vertici[10].yf:=0; vertici[10].x:=6; vertici[11].yI:=0; vertici[11].yf:=1; vertici[11].x:=4; vertici[12].yI:=1; vertici[12].yf:=0; vertici[12].x:=2; vertici[13].yI:=0; vertici[13].yf:=8; vertici[13].x:=0; For x:=1 To 13 do begin XX:=10; vertici[x].x:=vertici[x].x*XX; vertici[x].yI:=vertici[x].yI*XX; vertici[x].yf:=vertici[x].yF*XX; vertici[x].n:=x; end ; {; invert yI e YF se yI>yF} YMin:=255; YMax:=0; For k:=1 To 13 do begin If vertici[k].yI > vertici[k].yF then begin yy:=vertici[k].yI; vertici[k].yI:=vertici[k].yF; vertici[k].yf:=yy; End; If vertici[k].yI < ymin then begin ymin:=vertici[k].yI; end; If vertici[k].yF > YMax then begin ymax:=vertici[k].yF; End; end; { for k:=1 to 20 do begin writeln (k:4,vertici[k].yI:4,vertici[k].yF:4,vertici[k].x:4,vertici[k].n:4); end; repeat until keypressed; {; For k=1 To 13 ; If vertici[k].yI < vertici[k].yF ; FrontColor(RGB(0,255,0)) ; Finally, red lines.. ; Else ; FrontColor(RGB(255,0,0)) ; EndIf ; ; LineXY(vertici[k].x*10,vertici[k].yI*10,vertici[k].x*10, vertici[k].yF*10) ; Next } { ; ordina per y} i:=1; While i<13 do begin minus:=0; If vertici[i].x > vertici[i+1].x then begin {writeln ; writeln (1,i:4,vertici[i].yI:4,vertici[i].yF:4,vertici[i].x:4,vertici[i].n:4); writeln (1,i+1:4,vertici[i+1].yI:4,vertici[i+1].yF:4,vertici[i+1].x:4,vertici[i+1].n:4); } MySwap[0]:= vertici[i]; vertici[i]:=vertici[i+1]; vertici[i+1]:=MySwap[0]; { writeln ; writeln (2,i:4,vertici[i].yI:4,vertici[i].yF:4,vertici[i].x:4,vertici[i].n:4); writeln (2,i+1:4,vertici[i+1].yI:4,vertici[i+1].yF:4,vertici[i+1].x:4,vertici[i+1].n:4); repeat until keypressed; } if i>1 then i:=i-1; minus:=1; end; If vertici[i].x = vertici[i+1].x then begin If vertici[i].yI > vertici[i+1].yI then begin MySwap[0]:= vertici[i]; vertici[i]:=vertici[i+1]; vertici[i+1]:=MySwap[0]; if i>1 then i:=i-1; minus:=1; end end; if minus=0 then i:=i+1; end; {for k:=1 to 20 do begin writeln (k:4,vertici[k].yI:4,vertici[k].yF:4,vertici[k].x:4,vertici[k].n:4); end ; } { writeln(ymin:4,ymax:4); XStart:=-1; writeln(XStart:4); repeat until keypressed; read (kbd,ch);} for k:=1 To 13 do begin line_b(vertici[k].x,vertici[k].yI+50,vertici[k].x, vertici[k].yF+50,15,0); end; XStart:=-1; For i:=ymin To YMax do begin For k:=1 To 13 do begin If (i>Vertici[k].yi) And (i<=Vertici[k].yf) then begin If xStart=-1 then xstart:=vertici[k].x Else begin {If Mod(I, 2)=0 FrontColor(RGB(0,0,255)) Else FrontColor(RGB(0,255,255)) EndIf*} Line_B(xstart,i+50,Vertici[k].x, i+50,5,0) ; xstart:=-1; End; end; end; end; pptn('press any key to re-fill :)',10,0,false); repeat until keypressed; read (kbd,ch); Tasto:=ord(Ch); until tasto=27; End.fill2 2E9B D200 FILL2.PAS function Collision(x1,y1,w,h,x2,y2,w2,h2:integer):boolean; begin Collision:=false; if (x1x2) and (y1y2) then Collision:=true; end; procedure delay(valor:integer); var OJ: integer; begin OJ:=Jiffy; Jiffy:=0; repeat until Jiffy>=valor; Jiffy:=OJ; end; function RND(vr: byte):byte; var j:byte; begin for j:=0 to random(100) do begin RND:=random(vr); end; end; function vdp_status_reg(reg:byte):byte; var waarde:byte; begin inline($3a/reg/ { LD A,(REG) } $fd/$2a/$f7/$fa/ { LD IY,(&HFAF7) } $dd/$21/$31/$01/ { LD IX,&H0131 } $cd/$1c/$00/ { CALL &H001C } $32/waarde/ { LD (WAARDE),A } $fb); { EI } vdp_status_reg:=waarde end; procedure set_scroll(x:integer;y,stil,aantal,scr:byte); var reg25,reg26,reg27:byte; procedure wrtvdp(reg,data:byte); begin inline($3a/reg/ { LD A,(REG) } $4f/ { LD C,A } $3a/data/ { LD A,(DATA) } $47/ { LD B,A } $fd/$2a/$f7/$fa/ { LD IY,(&HFAF7) } $dd/$21/$2d/$01/ { LD IX,&H012D } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; begin if scr=12 then reg25:=8 else if scr in [10..11] then reg25:=24 else reg25:=0; reg25:=reg25 or (2*stil); reg25:=reg25 or aantal; reg26:=(x and $fff8) shr 3; reg27:=7-(x and $0007); wrtvdp(23,y); wrtvdp(25,reg25); wrtvdp(27,reg27); wrtvdp(26,reg26); end; procedure line_b(x,y,x2,y2:integer;kleur,log_op:byte); begin mem[$fcb3]:=lo(x2);mem[$fcb4]:=hi(x2); mem[$fcb5]:=lo(y2);mem[$fcb6]:=hi(y2); mem[$f3f2]:=kleur; mem[$fb02]:=log_op; inline($ed/$4b/x/ { LD BC,(X) } $ed/$5b/y/ { LD DE,(Y) } $fd/$2a/$f7/$fa/ { LD IY,(&HFAF7) } $dd/$21/$c9/$00/ { LD IX,&H00C9 } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; procedure line_bf(x,y,x2,y2:integer;kleur,log_op:byte); begin mem[$fcb3]:=lo(x2);mem[$fcb4]:=hi(x2); mem[$fcb5]:=lo(y2);mem[$fcb6]:=hi(x2); mem[$f3f2]:=kleur; mem[$fb02]:=log_op; inline($ed/$4b/x/ { LD BC,(X) } $ed/$5b/y/ { LD DE,(Y) } $fd/$2a/$f7/$fa/ { LD IY,(&HFAF7) } $dd/$21/$cd/$00/ { LD IX,&H00CD } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; procedure scr_off; begin inline($fd/$2a/$c0/$fc/ { LD IY,(&HFCC0) } $dd/$21/$41/$00/ { LD IX,&H0041 } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; procedure scr_on; begin inline($fd/$2a/$c0/$fc/ { LD IY,(&HFCC0) } $dd/$21/$44/$00/ { LD IX,&H0044 } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; procedure switch_to_Z80; begin inline($3e/$00/ { LD A,0 } $fd/$2a/$c0/$fc/ { LD IY,(&HFCC0) } $dd/$21/$80/$01/ { LD IX,&H0180 } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; procedure switch_to_R800; begin inline($3e/$00/ { LD A,1 } $fd/$2a/$c0/$fc/ { LD IY,(&HFCC0) } $dd/$21/$80/$01/ { LD IX,&H0180 } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; function processor_type:byte; var soort:byte; begin inline($fd/$2a/$c0/$fc/ { LD IY,(&HFCC0) } $dd/$21/$83/$01/ { LD IX,&H0183 } $cd/$1c/$00/ { CALL &H001C } $32/soort/ { LD (SOORT),A } $fb); { EI } processor_type:=soort end; function msx_version:byte; var v:byte; begin inline($3a/$c1/$fc/ { LD A,(&HFCC1) ; slot da ROM BIOS } $21/$2d/$00/ { LD HL,&H002D } $cd/$0c/$00/ { CALL &H000C } $32/v); { LD (V),A } msx_version:=v+1 end; function ctrl_stop_pressed:boolean; begin ctrl_stop_pressed:=((mem[$fbeb] and 2)=0) and ((mem[$fbec] and 16)=0); end; function stop_pressed:boolean; begin stop_pressed:=((mem[$fbec] and 16)=0); end; function pressed_function_key:byte; var nummer:byte; begin nummer:=0; if (mem[$fbeb] and 32)=0 then nummer:=1; if (mem[$fbeb] and 64)=0 then nummer:=2; if (mem[$fbeb] and 128)=0 then nummer:=3; if (mem[$fbec] and 1)=0 then nummer:=4; if (mem[$fbec] and 2)=0 then nummer:=5; if ((mem[$fbeb] and 1)=0) and (nummer<>0) then nummer:=nummer+5; pressed_function_key:=nummer end; procedure set_adjust(horizontaal,verticaal:integer); var reg,horiz,verti:byte; begin if horizontaal<=0 then horiz:=-horizontaal else horiz:=15-horizontaal; if verticaal<=0 then verti:=15+verticaal else verti:=verticaal; reg:=16*verti+horiz; inline($3a/reg/ { LD A,(REG) } $47/ { LD B,A } $0e/$12/ { LD C,&H12 } $dd/$21/$2d/$01/ { LD IX,&H012D } $fd/$2a/$f7/$fa/ { LD IY,(&HFAF7) } $cd/$1c/$00/ { CALL &H001C } $fb) { EI } end; Procedure WriteMem(endereco:integer; texto:tpstring); var indice:integer; begin for indice:=1 TO length(texto) DO begin mem[Endereco]:=ORD(texto[indice]); Endereco:=Endereco+1; end; Mem[Endereco]:=0 end; Procedure Play(MUSIC:tpstring); { music is loaded at F41Fh and the code at F5EEh this is a direct call to PLAY basic command } var slot:byte; begin WriteMem($F41F,MUSIC); if port[168]=$ff then slot:=$f0 else slot:=$a0; WriteMem($F5EE, #$DB+#$A8+#$F5+#$3E+chr(slot)+#$D3+#$A8+ #$21+ #$1F+#$F4+ #$CD+#$E5+#$73+ #$F1+#$D3+#$A8+#$C9); INLINE($C3/$EE/$F5); END; Function InStr(StartPos:integer; substr, ttext:tpstring): integer; { returns the position where substr appears on ttext from StartPos more flexible than the pascal Pos() funcion } var l,result:integer; begin if (StartPos>length(ttext)) or (StartPos<1) then InStr:=-1 else begin InStr:=-1; l:=length(ttext); result:=Pos(substr,Copy(ttext,StartPos,l-StartPos+1)); if result>0 then InStr:=result+(StartPos-1); { else InStr:=-1; } end; end; {-----------------------------------------------------------------------------} { General Declarations } {-----------------------------------------------------------------------------} Type TPString = String[255]; {Command array for the Vdp access } Var _sx :Integer Absolute $f562 ; _sy :Integer Absolute $f564 ; _dx :Integer Absolute $f566 ; _dy :Integer Absolute $f568 ; _nx :Integer Absolute $f56a ; _ny :Integer Absolute $f56c ; _col :Byte Absolute $f56e ; _arg :Byte Absolute $f56f ; _cmd :Byte Absolute $f570 ; Var Jiffy: integer absolute $FC9E; ClickSW: integer absolute $F3DB; {Vdp Copy commands } Const HMMC = $F0 ; {High speed Byte Cpu -> Vram } YMMM = $E0 ; {High speed Byte Vram -> Vram in y-axis } HMMM = $D0 ; {High speed Byte Vram -> Vram in x- and y-axis } HMMV = $C0 ; {High speed Byte Vdp -> Vram = paint a box } LMMC = $B0 ; {Logical Dot Cpu -> Vram } LMCM = $A0 ; {Logical Dot Vram -> Cpu } LMMM = $90 ; {Logical Dot Vram -> Vram } LMMV = $80 ; {Logical Dot Vdp -> Vram = paint a box } {Copy directions for the ARG-register } Copy_Right = 0; Copy_Down = 0; Copy_Left = 4; Copy_Up = 8; ExpansionVram = 32 ; Vram = 0 ; Const TPSET=8; Procedure Screen(mode:Byte); { Igual ao screen do Basic } Const EXPTBL = $fcc0; CALSLT = $001C; CHGMOD = $005F; Begin Inline ( $f3 { di } /$3a/mode { LD A,(MODE) } /$fd/$2a/$c0/$fc { LD IY,(EXPTBL - 1 } /$DD/$21/$5f/00 { LD IX,CHGMOD } /$CD/$1c/00 { CALL CALSLT } /$fb { EI } ); End; Procedure Color(ForeGroundColor,BackGroudColor,BorderColor:Byte); { Igual ao color do Basic } Var FORCLR :Byte Absolute $F3E9; BAKCLR :Byte Absolute $f3ea; BDRCLR :Byte Absolute $f3eb; Begin FORCLR := ForeGroundColor; BAKCLR := BackGroudColor; BDRCLR := BorderColor; Inline ( $f3/ $fd/$2a/$c0/$fc { LD IY,(EXPTBL - 1 } /$DD/$21/$62/00 { LD IX,CHGCLR } /$CD/$1c/00/$fb { CALL CALSLT } ); End; Procedure Print(Col,Lin:integer; color:byte; Texto:TPstring); Var Indice: integer; Letra: Char; FORCLR:Byte Absolute $F3E9; OldColor: integer; Begin OldColor:=FORCLR; FORCLR := Color; inline($f3); For Indice:=1 to Length(Texto) do begin Letra:=Texto[Indice]; inline( $3A/col/ { LD A,col } $32/$B7/$FC/ { LD ($FCB7),col } $3A/lin/ { LA A,lin } $32/$B9/$FC/ { LD ($FCB7),col } $3a/Letra/ $fd/$2a/$c0/$fc/ $DD/$21/$8d/$00/ $cd/$1c/$00 ); Col:=Col+6; if Col>255 then begin Col:=0; Lin:=Lin+8; end; end; inline($fb); FORCLR:=OldColor; end; Procedure SetPage(DisplayPage,ActivePage:Byte); Const SETPAGE = $013D; {SubRom routine} Var DPPAGE :Byte Absolute $FAF5; ACPAGE :Byte Absolute $FAF6; Begin DpPage := DispLayPage; AcPage := ActivePage; Inline ( $f3 /$fd/$2a/$f7/$fa { LD IY,(EXbrsa - 1 } /$DD/$21/$3d/$01 { LD IX,setpage } /$CD/$1c/00 { CALL CALSLT } /$fb ); End; Var VA:byte; VHL,VBC,VDE:integer; Const GTSTCK=$D5; {retorna o estado do joystick selecionado} GTTRIG=$D8; {retorna o estado do botao de disparo selecionado} WRTPSG=$93; {grava um byte num registro do PSG} Procedure CallRom(VIX:integer); BEGIN inline($F3/$CD/*+19/$FB/$32/VA/$22/VHL/$ED/$43/VBC/$ED/$53/VDE/$18/$1B/ $DD/$2A/VIX/$3A/VA/$2A/VHL/$ED/$4B/VBC/$ED/$5B/VDE/$08/$DB/$A8/ $F5/$E6/$F0/$C3/$8C/$F3/$FB); END; Function Stick(n:byte):byte; BEGIN VA:=n; CallRom(GTSTCK); Stick:=VA; END; Function Strig(n:byte):boolean; BEGIN VA:=n; CallRom(GTTRIG); Strig:=(va<>0); END; Procedure Sound(r,v:byte); BEGIN VA:=r; VDE:=v; CallRom(WRTPSG); END; Procedure _MoveDotToVram(SourceAddress :Integer;Destination_x, Destination_y:Integer;DestinationPage:Byte;Number_x,Number_y:Integer; LogicalOperation,Direction:Byte); Var Address :Integer; Begin Address := SourceAddress+1; {Because the firstbyte is set in CMD array. } _cmd:= LMMC + LogicalOperation; _dy := DestinationPage * 256 + Destination_y ; _arg:= Direction ; _dx := Destination_x; _nx := Number_x; _ny := Number_y; _col:= Mem[Address-1]; Inline ($f3/$DD/$2A/Address/ $3E/$02/$D3/$99/$3E/$8F/$D3/$99/$DB/$99/$CB/$47/ $20/$F2/$F3/$3E/$20/$D3/$99/$3E/$11/$F6/$80/$D3/$99/$06/$0F/$0E/ $9B/$21/$62/$F5/$ED/$B3/$3E/$2C/$F6/$80/$D3/$99/$3E/$11/$F6/$80/ $D3/$99/$3E/$02/$D3/$99/$3E/$8F/$D3/$99/$DB/$99/$CB/$47/$28/$0D/ $CB/$7F/$28/$EE/$DD/$7E/$00/$DD/$23/$D3/$9B/$18/$E5/$3E/$00/$D3/ $99/$3E/$8F/$D3/$99/$DB/$99/$fb); end ; {Lmmc} Type StringType = String[80]; Procedure LoadGraphic(FileName :StringType; Width, Height: Integer; x,y:Integer; Page:Byte;LogOp, ScrMod :Byte); Var ReadBuf :^Integer; Temp :Integer Absolute ReadBuf; DotBuf :^Integer; DotTemp :Integer Absolute DotBuf; Counter,yy :Integer; BufSize :Integer; Begin Case ScrMod Of 0,1,2,3,4 :BufSize := 256 ; {Dummy option} 5,7 :BufSize := 512 ; 6 :BufSize := 1024; 8 :BufSize := 256 ; End; GetMem(ReadBuf,256); GetMem(DotBuf,BufSize); FcbPointer := MsxOpen(filename); Counter :=Width Div (BufSize Div 256) ; yy :=y; MsxRead(FcbPointer,counter,1,Temp); While (MsxIOResult = 0) Do Begin Case ScrMod Of 5,7 :Inline($f3/$2A/Temp/$ED/$5B/DotTemp/$ED/$4B/Counter /$7E/$F5/$CB/$3F/$CB/$3F/$CB/$3F/$CB/$3F/$12/$13/$F1/$E6/ $0F/$12/$13/$23/$0B/$78/$B1/$20/$E9/$fb); {Split one 8-byte to two 4-bit bytes} 6 :Inline ($f3/$DD/$2A/Temp /$FD/$2A/DotTemp /$ED/$5B/Counter /$DD/$7E/$00/$06/$04/$0E/$00/$17/$CB/ $11/$17/$CB/$11/$FD/$71/$00/$FD/$23/$10/$F1/$1B/$DD/$23/ $7A/$B3/$20/$E5/$fb); {Split one 8-byte to four 2-bit bytes} 8 :Inline ($f3/ $2a/Temp /$ed/$5b/DotTemp /$ed/$4b /Counter / $ed/$b0/$f3/$fb); {Moves 8-bit data directly from readbuf to Vrambuf.} End; {Case} _MoveDotToVram(DotTemp,x,yy,Page,Width,1,LogOp,0); yy :=yy+1; MsxRead(FcbPointer,counter,1,Temp); End; MsxClose(FcbPointer); FreeMem(ReadBuf,256); FreeMem(DotBuf,BufSize); End; Procedure cls2; begin inline ($f3/$af/ { xor a } $fd/$2a/$c0/$fc/ { ld iy,(#fcc0) } $dd/$21/$c3/$00/ { ld ix,#c3 } $cd/$1c/$00/$fb); { call #1c } end; Procedure Common; begin Inline ( $F3/ { DI } $3E/$20/ { LD A, 20h } $D3/$99/ { OUT (99h),A } $3E/$91/ { LD A, 11h } $D3/$99/ { OUT (99h),A } $0E/$9B/ { LD C, 9Bh } $21/$62/$F5/ { LD HL,F562h } $ED/$A3/ { 15x OUTI, faster } $ED/$A3/ { than OTIR } $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $ED/$A3/ $3E/$02/ { LD A, 02h } $D3/$99/ { OUT (99h),A } $3E/$80/ { LD A, 0fh } $F6/$0f/ { OR 80h } $D3/$99/ { OUT (99h),A } $DB/$99/ { IN (99h),A } $CB/$47/ { BIT 0,A } $20/$F0/ { JR NZ, F0h } $AF/ { XOR A } $D3/$99/ { OUT (99h),A } $3E/$8F/ { LD A, 0fh } $D3/$99/ { OUT (99h),A } $FB { EI } ); end; Procedure Copy_y (Source_x,Source_y:Integer;SourcePage:Byte; Destination_y,Number_y:Integer;DestinationPage:Byte; Direction:Byte); Begin _cmd:= YMMM ; _sy := SourcePage * 256 + Source_y ; _dy := DestinationPage * 256 + Destination_y ; _arg:= Direction ; _dx := Source_x; {It`s not an error ! It's really like this.} {_sx := sx; <- Not used ! } {_nx := Number_x; <- Not used ! } _ny := Number_y; Common; End ; {Copy_y} Procedure Copy(X1,Y1,X2,Y2,SrcPage,DestX,DestY,DestPage:integer); begin _cmd:= HMMM ; _sy := SrcPage*256 + y1 ; _dy := DestPage*256 + Desty ; _arg:= 0; _dx := Destx; _sx := x1; _nx := x2-x1+1; _ny := y2-y1+1; Common; end; Procedure CopyL(X1,Y1,X2,Y2,SrcPage,DestX,DestY,DestPage:integer; LogOp:byte); begin _cmd:= LMMM + LogOp ; _sy := SrcPage*256 + y1 ; _dy := DestPage*256 + Desty ; _arg:= 0; _dx := Destx; _sx := x1; _nx := x2-x1+1; _ny := y2-y1+1; Common; end; function Inkey:char; var bt:integer; qqc:byte absolute $FCA9; begin Inkey:=chr(0); qqc:=1; Inline($f3/$fd/$2a/$c0/$fc/$DD/$21/$9F/00 /$CD/$1c/00/$32/bt/$fb); Inkey:=chr(bt); qqc:=0; end; Procedure HideScreen; begin inline($FD/$2A/$C1/$FC/$DD/$21/$41/$00/$CD/$1C/$00); end; Procedure ShowScreen; begin INLINE ($fd/$2a/$c1/$fc/$dd/$21/$44/$00/$cd/$1c/$00); end; ELPS    (/4:Dcfs  AUZiqt /; 2Jy, uCu+:iB(z*?#"?:>Ļ*?:?GÑ)*:>:?U<2?>*͖#ͨy,(:>=+G2>:>= 2>6 MSX-DOS version 1.03 Copyright 1984 by Microsoft $1!0@:@! BRo|O!^#V#z( |g~w,(͔+>*y, uCu+:iB(z*?#"?:>Ļ*?:?GÑ)*:>:?U<2?>*͖#ͨy,(:>=+G2>:>= 2>:>! "#!"%!@~t2ð$_TT(=‚4=2?<2>Â5:>_2>W!>7~ ,>0w!>4:?ʑ2?!>(4:>=2 ?͐,z͐,z/(į:>͂=:>͂7:?(!͖W  B(?:?”+!"&?,7, "&?x(7, ~, #"&?, "&?y1mAy [2"!yG(! (( ( &ET̓Q_I R A2h1 :;( ]S:(QET_N(Y 2k1 h! "!">22ͩP*K~#_~#W x *R *k[ bD( pNT!"| "~ #"i !"=[ !ͲG(kG>2y10s1  S [!! ~#F#fh2=(">@O< ~O@hk:=(O[>!@< O:(o`{{ETSnTtTeTTTbTNTP=s1 hx@k{ys1 h͏@k{COMMAND COMType Fcb = Record Drive :Byte; FileName :Array[1..11] Of Char; CurBlock :Integer; RecSize :Integer; FileSizeLo :Integer; FileSizeHi :Integer; Date :Integer; Time :Integer; DeviceId :Byte; DirLoc :Byte; TopCluster :Integer; LastAccessd :Integer; RelLoc :Integer; CurRec :Integer; RanRecLo :Integer; RanRecHi :Integer; End; {Fcb} OpenString = String[12]; FcbPointerType = ^Fcb; Var FcbPointer :FcbPointerType; MSXIOResult :Byte; Function MSXOpen(Filename:OpenString):FcbPointerType; Var Drv,Ch :Char; i,j :Byte; FcbPointer :FcbPointerType; Begin New(FcbPointer); With FcbPointer^ Do { Clear FCB } Begin Drive := 0 ; For i := 1 To 11 Do FileName[i] := Chr(32); CurBlock := 0 ; RecSize := 0 ; FileSizeLo := 0 ; FileSizeHi := 0 ; Date := 0 ; Time := 0 ; DeviceId := 0 ; DirLoc := 0 ; TopCluster := 0 ; LastAccessd := 0 ; RelLoc := 0 ; CurRec := 0 ; RanRecLo := 0 ; RanRecHi := 0 ; End; { Prepare FileName for FCB } If Pos(':',FileName) = 0 Then FcbPointer^.Drive := 0 Else Begin Drv := UpCase(Filename[1]); FcbPointer^.Drive := Ord(Drv) - Ord('A') + 1; End; j:= 1; i := Pos(':',FileName) + 1 ; While (FileName[i] <> '.') And (i < (Pos(':',FileName)+9 )) And ( i <= Length(FileName) ) Do Begin FcbPointer^.FileName[j] := FileName[i]; i := i + 1; j := j + 1; End; {While} If Pos('.', FileName) <> 0 Then Begin i := Pos('.',FileName) + 1; j := 9; While (i < (Pos('.',FileName)+4 )) And ( i <= Length(FileName) ) Do Begin FcbPointer^.FileName[j] := FileName[i]; i := i + 1; j := j + 1; End; {While} End; {If} Inline ( $ed/$5b/ FcbPointer / $0e/$0f/ { LD C,OPEN } $cd/05/00/ $32/MSXIOResult ); If MSXIOResult = 0 Then MSXOpen := FcbPointer Else MsxOpen := Nil; End; {MsxOpen} Function MSXCreate(Filename:OpenString):FcbPointerType; Var Drv,Ch :Char; i,j :Byte; FcbPointer :FcbPointerType; Begin New(FcbPointer); With FcbPointer^ Do { Clear FCB } Begin Drive := 0 ; For i := 1 To 11 Do FileName[i] := Chr(32); CurBlock := 0 ; RecSize := 0 ; FileSizeLo := 0 ; FileSizeHi := 0 ; Date := 0 ; Time := 0 ; DeviceId := 0 ; DirLoc := 0 ; TopCluster := 0 ; LastAccessd := 0 ; RelLoc := 0 ; CurRec := 0 ; RanRecLo := 0 ; RanRecHi := 0 ; End; { Prepare FileName for FCB } If Pos(':',FileName) = 0 Then FcbPointer^.Drive := 0 Else Begin Drv := UpCase(Filename[1]); FcbPointer^.Drive := Ord(Drv) - Ord('A') + 1; End; j:= 1; i := Pos(':',FileName) + 1 ; While (FileName[i] <> '.') And (i < (Pos(':',FileName)+9 )) And ( i <= Length(FileName) ) Do Begin FcbPointer^.FileName[j] := FileName[i]; i := i + 1; j := j + 1; End; {While} If Pos('.', FileName) <> 0 Then Begin i := Pos('.',FileName) + 1; j := 9; While (i < (Pos('.',FileName)+4 )) And ( i <= Length(FileName) ) Do Begin FcbPointer^.FileName[j] := FileName[i]; i := i + 1; j := j + 1; End; {While} End; {If} Inline ( $ed/$5b/ FcbPointer / $0e/$16/ { LD C,CREATE } $cd/$05/$00/ $32/MSXIOResult ); If MsxIOResult = 0 Then MSXCreate := FcbPointer Else MsxCreate := Nil; End; {MsxCreate} Procedure MSXClose(FcbPointer:FcbPointerType); Begin Inline ($ed/$5b/ FcbPointer / $0e/$10/ { LD C,Close } $cd/$05/$00/ $32/MSXIOResult ); Dispose(FcbPointer); End; {MsxClose} Procedure MSXWrite( FcbPointer:FcbPointerType;RecordSize,RecordCount,BufferAddr:Integer); {BufferAddr = DMA in DOS } Begin Inline ( $ed/$5b/ BufferAddr / $0e/$1a/ { LD C,SET_DMA } $cd/$05/$00 ); FcbPointer^.RecSize := RecordSize; {You could as well set the Sandom Rec Lo and Hi ie. record number in FCB.} Inline ( $ed/$5b/ FcbPointer / $0e/$26/ { LD C,Random_Write } $2a/ RecordCount / $cd/$05/$00/ $32/MSXIOResult ); Inline ( $0e/$0d/ { Reset disk drive parameters } $cd/$05/$00 ); End; {MsxWrite} Procedure MSXRead( FcbPointer:FcbPointerType;RecordSize,RecordCount,BufferAddr:Integer); {BufferAddr = DMA in DOS } Begin Inline ( $ed/$5b/ BufferAddr / $0e/$1a/ { LD C,SET_DMA } $cd/$05/$00 ); FcbPointer^.RecSize := RecordSize; {You could as well set the Sandom Rec Lo and Hi ie. record number in FCB.} Inline ( $ed/$5b/ FcbPointer / $0e/$27/ { LD C,Random_Read } $2a/ RecordCount / $cd/$05/$00/ $32/MSXIOResult ); End; {MsxRead} Procedure MSXSeek(FcbPointer:FcbPointerType;RecNumberLo,RecNumberHi:Integer); Begin FcbPointer^.RanRecLo := RecNumberLo; FcbPointer^.RanRecHi := RecNumberHi; End;  type TPal = record r:array[0..15] of byte; g:array[0..15] of byte; b:array[0..15] of byte; end; Var CurPal: TPal; { ******************************************************************** } procedure setpalette (nr,r,g,b: byte); { set palette number nr, with r,g,b values } begin inline ($ed/$5b/g/ { ld de,(g) } $3a/nr/$57/ { ld a,(nr): ld d,a } $3a/r/ { ld a,(rood) } $07/$07/$07/$07/ { 4* rlca } $47/ { ld b,a } $3a/b/$b0/ { ld a,(b): or b } $fd/$2a/$f7/$fa/ { ld iy,(#faf7) } $dd/$21/$4d/$01/ { ld ix,#014d } $cd/$1c/$00); { call #1c } end; { ******************************************************************** } procedure getpalette (nr: Byte; var r,g,b: Byte); { get current palette } var r2,g2,b2: Byte; begin inline ($3a/nr/ $fd/$2a/$f7/$fa/ { ld iy,(#faf7) } $dd/$21/$49/$01/ { ld ix,#0149 } $cd/$1c/$00/ { call #1c } $79/$32/g2/ { ld a,c: ld (g2),a } $78/$32/b2); { ld a,b: ld (b2),a } G:=G2 and 15; R:=(B2 SHR 4); B:= B2 and 15; end; { ******************************************************************** } procedure inipalette; { reset palette to default values } begin inline ($fd/$2a/$f7/$fa/ { ld iy,(#faf7) } $dd/$21/$41/$01/ { ld ix,#0141 } $cd/$1c/$00); { call #1c } end; { ******************************************************************** } procedure LoadPal(fname: OpenString; spal:byte); { fname: PL5 palette filename spal: 0->only loads the palette on CurPal; >0 also sets the palette automatically } type PBuffer = array[1..39] of byte; var arq: file of PBuffer; PalBuffer: PBuffer; fr,cor:integer; begin assign(arq, fname); reset(arq); read(arq,palbuffer); {If (Palbuffer[1]=$FE) and (Palbuffer[2]=$80) and (Palbuffer[4]=$9F) then begin} fr:=8; cor:=0; while cor<16 do begin CurPal.r[cor]:=Round(palbuffer[fr] shr 4); CurPal.g[cor]:=Round(palbuffer[fr+1]); CurPal.b[cor]:=Round(palbuffer[fr] and $0F); if spal>0 then setpalette(cor, CurPal.r[cor], CurPal.g[cor], CurPal.b[cor]); fr:=fr+2; cor:=cor+1; end; {end;} close(arq); end; { ******************************************************************** } procedure FadeOUT; { does it really needs a description? } var fk, fr,fl: integer; bR, bG, bB: byte; OTime:integer; begin fl:=0; While fl<8 do begin for fr:=0 to 15 do begin getpalette(15-fr,bR,bG,bB); if bR>0 then bR:=bR-1; if bG>0 then bG:=bG-1; if bB>0 then bB:=bB-1; setpalette(15-fr,bR,bG,bB); end; fl:=fl+1; end; end; { ******************************************************************** } procedure BlackOut; { set everything BLACK } var fr: integer; begin for fr:=0 to 15 do begin setpalette(15-fr,0,0,0); end; end; { ******************************************************************** } Procedure FadeIn; { Fades In a screen from a blacked out palette to CurPal. Don't forget to call first FadeOUT or BlackOut } var fk, fr,fl: integer; bR, bG, bB: byte; TempPal: TPal; begin fl:=0; for fr:=0 to 15 do begin TempPal.r[fr]:=0; TempPal.b[fr]:=0; TempPal.g[fr]:=0; end; While fl<8 do begin for fr:=0 to 15 do begin {getpalette(fr,bR,bG,bB);} if TempPal.r[fr]'..') and (Chn1<>'MT') then begin if chn1='C1' then begin s0:=98; s1:=13; end; if chn1='D1' then begin s0:=245; s1:=11; end; if chn1='E1' then begin s0:=149; s1:=10; end; if chn1='F1' then begin s0:=3; s1:=10; end; if chn1='G1' then begin s0:=235; s1:=8; end; if chn1='A1' then begin s0:=240; s1:=7; end; if chn1='B1' then begin s0:=18; s1:=7; end; if chn1='C2' then begin s0:=178; s1:=6; end; if chn1='D2' then begin s0:=242; s1:=5; end; if chn1='E2' then begin s0:=78; s1:=5; end; if chn1='F2' then begin s0:=1; s1:=5; end; if chn1='G2' then begin s0:=117; s1:=4; end; if chn1='A2' then begin s0:=249; s1:=3; end; if chn1='B2' then begin s0:=137; s1:=3; end; if chn1='C3' then begin s0:=87; s1:=3; end; if chn1='D3' then begin s0:=250; s1:=2; end; if chn1='E3' then begin s0:=167; s1:=2; end; if chn1='F3' then begin s0:=129; s1:=2; end; if chn1='G3' then begin s0:=59; s1:=2; end; if chn1='A3' then begin s0:=253; s1:=1; end; if chn1='B3' then begin s0:=197; s1:=1; end; if chn1='C4' then begin s0:=172; s1:=1; end; if chn1='D4' then begin s0:=125; s1:=1; end; if chn1='E4' then begin s0:=83; s1:=1; end; if chn1='F4' then begin s0:=64; s1:=1; end; if chn1='G4' then begin s0:=29; s1:=1; end; if chn1='A4' then begin s0:=254; s1:=0; end; if chn1='B4' then begin s0:=226; s1:=0; end; if chn1='C5' then begin s0:=214; s1:=0; end; if chn1='D5' then begin s0:=190; s1:=0; end; if chn1='E5' then begin s0:=170; s1:=0; end; if chn1='F5' then begin s0:=160; s1:=0; end; if chn1='G5' then begin s0:=143; s1:=0; end; if chn1='A5' then begin s0:=127; s1:=0; end; if chn1='B5' then begin s0:=113; s1:=0; end; if chn1='C6' then begin s0:=107; s1:=0; end; if chn1='D6' then begin s0:=95; s1:=0; end; if chn1='E6' then begin s0:=85; s1:=0; end; if chn1='F6' then begin s0:=80; s1:=0; end; if chn1='G6' then begin s0:=71; s1:=0; end; if chn1='A6' then begin s0:=64; s1:=0; end; if chn1='B6' then begin s0:=57; s1:=0; end; if chn1='C7' then begin s0:=53; s1:=0; end; if chn1='D7' then begin s0:=48; s1:=0; end; if chn1='E7' then begin s0:=42; s1:=0; end; if chn1='F7' then begin s0:=40; s1:=0; end; if chn1='G7' then begin s0:=36; s1:=0; end; if chn1='A7' then begin s0:=32; s1:=0; end; if chn1='B7' then begin s0:=28; s1:=0; end; if chn1='C8' then begin s0:=27; s1:=0; end; if chn1='D8' then begin s0:=24; s1:=0; end; if chn1='E8' then begin s0:=21; s1:=0; end; if chn1='F8' then begin s0:=20; s1:=0; end; if chn1='G8' then begin s0:=18; s1:=0; end; if chn1='A8' then begin s0:=16; s1:=0; end; if chn1='B8' then begin s0:=14; s1:=0; end; if chn1='AB' then begin s0:=224; s1:=1; end; { A#3 } if chn1='AC' then begin s0:=240; s1:=0; end; { A#4 } IF chn1='DB' then begin s0:=207; s1:=2; end; { D#3 } if chn1='DC' then begin s0:=104; s1:=1; end; { D#4 } if chn1='DD' then begin s0:=180; s1:=0; end; { D#5 } if chn1='FB' then begin s0:=93; s1:=2; end; { F#3 } if chn1='GB' then begin s0:=27; s1:=2; end; { G#3 } if chn1='GC' then begin s0:=13; s1:=1; end; { G#4 } end; if (Chn2<>'..') and (Chn2<>'MT') then begin if chn2='C1' then begin s2:=98; s3:=13; end; if chn2='D1' then begin s2:=245; s3:=11; end; if chn2='E1' then begin s2:=149; s3:=10; end; if chn2='F1' then begin s2:=3; s3:=10; end; if chn2='G1' then begin s2:=235; s3:=8; end; if chn2='A1' then begin s2:=240; s3:=7; end; if chn2='B1' then begin s2:=18; s3:=7; end; if chn2='C2' then begin s2:=178; s3:=6; end; if chn2='D2' then begin s2:=242; s3:=5; end; if chn2='E2' then begin s2:=78; s3:=5; end; if chn2='F2' then begin s2:=1; s3:=5; end; if chn2='G2' then begin s2:=117; s3:=4; end; if chn2='A2' then begin s2:=249; s3:=3; end; if chn2='B2' then begin s2:=137; s3:=3; end; if chn2='C3' then begin s2:=87; s3:=3; end; if chn2='D3' then begin s2:=250; s3:=2; end; if chn2='E3' then begin s2:=167; s3:=2; end; if chn2='F3' then begin s2:=129; s3:=2; end; if chn2='G3' then begin s2:=59; s3:=2; end; if chn2='A3' then begin s2:=253; s3:=1; end; if chn2='B3' then begin s2:=197; s3:=1; end; if chn2='C4' then begin s2:=172; s3:=1; end; if chn2='D4' then begin s2:=125; s3:=1; end; if chn2='E4' then begin s2:=83; s3:=1; end; if chn2='F4' then begin s2:=64; s3:=1; end; if chn2='G4' then begin s2:=29; s3:=1; end; if chn2='A4' then begin s2:=254; s3:=0; end; if chn2='B4' then begin s2:=226; s3:=0; end; if chn2='C5' then begin s2:=214; s3:=0; end; if chn2='D5' then begin s2:=190; s3:=0; end; if chn2='E5' then begin s2:=170; s3:=0; end; if chn2='F5' then begin s2:=160; s3:=0; end; if chn2='G5' then begin s2:=143; s3:=0; end; if chn2='A5' then begin s2:=127; s3:=0; end; if chn2='B5' then begin s2:=113; s3:=0; end; if chn2='C6' then begin s2:=107; s3:=0; end; if chn2='D6' then begin s2:=95; s3:=0; end; if chn2='E6' then begin s2:=85; s3:=0; end; if chn2='F6' then begin s2:=80; s3:=0; end; if chn2='G6' then begin s2:=71; s3:=0; end; if chn2='A6' then begin s2:=64; s3:=0; end; if chn2='B6' then begin s2:=57; s3:=0; end; if chn2='C7' then begin s2:=53; s3:=0; end; if chn2='D7' then begin s2:=48; s3:=0; end; if chn2='E7' then begin s2:=42; s3:=0; end; if chn2='F7' then begin s2:=40; s3:=0; end; if chn2='G7' then begin s2:=36; s3:=0; end; if chn2='A7' then begin s2:=32; s3:=0; end; if chn2='B7' then begin s2:=28; s3:=0; end; if chn2='C8' then begin s2:=27; s3:=0; end; if chn2='D8' then begin s2:=24; s3:=0; end; if chn2='E8' then begin s2:=21; s3:=0; end; if chn2='F8' then begin s2:=20; s3:=0; end; if chn2='G8' then begin s2:=18; s3:=0; end; if chn2='A8' then begin s2:=16; s3:=0; end; if chn2='B8' then begin s2:=14; s3:=0; end; if chn2='AB' then begin s2:=224; s3:=1; end; { A#3 } if chn2='AC' then begin s2:=240; s3:=0; end; { A#4 } IF chn2='DB' then begin s2:=207; s3:=2; end; { D#3 } if chn2='DC' then begin s2:=104; s3:=1; end; { D#4 } if chn2='DD' then begin s2:=180; s3:=0; end; { D#5 } if chn2='FB' then begin s2:=93; s3:=2; end; { F#3 } if chn2='GB' then begin s2:=27; s3:=2; end; { G#3 } if chn2='GC' then begin s2:=13; s3:=1; end; { G#4 } end; if (Chn3<>'..') and (Chn3<>'MT') then begin if chn3='C1' then begin s4:=98; s5:=13; end; if chn3='D1' then begin s4:=245; s5:=11; end; if chn3='E1' then begin s4:=149; s5:=10; end; if chn3='F1' then begin s4:=3; s5:=10; end; if chn3='G1' then begin s4:=235; s5:=8; end; if chn3='A1' then begin s4:=240; s5:=7; end; if chn3='B1' then begin s4:=18; s5:=7; end; if chn3='C2' then begin s4:=178; s5:=6; end; if chn3='D2' then begin s4:=242; s5:=5; end; if chn3='E2' then begin s4:=78; s5:=5; end; if chn3='F2' then begin s4:=1; s5:=5; end; if chn3='G2' then begin s4:=117; s5:=4; end; if chn3='A2' then begin s4:=249; s5:=3; end; if chn3='B2' then begin s4:=137; s5:=3; end; if chn3='C3' then begin s4:=87; s5:=3; end; if chn3='D3' then begin s4:=250; s5:=2; end; if chn3='E3' then begin s4:=167; s5:=2; end; if chn3='F3' then begin s4:=129; s5:=2; end; if chn3='G3' then begin s4:=59; s5:=2; end; if chn3='A3' then begin s4:=253; s5:=1; end; if chn3='B3' then begin s4:=197; s5:=1; end; if chn3='C4' then begin s4:=172; s5:=1; end; if chn3='D4' then begin s4:=125; s5:=1; end; if chn3='E4' then begin s4:=83; s5:=1; end; if chn3='F4' then begin s4:=64; s5:=1; end; if chn3='G4' then begin s4:=29; s5:=1; end; if chn3='A4' then begin s4:=254; s5:=0; end; if chn3='B4' then begin s4:=226; s5:=0; end; if chn3='C5' then begin s4:=214; s5:=0; end; if chn3='D5' then begin s4:=190; s5:=0; end; if chn3='E5' then begin s4:=170; s5:=0; end; if chn3='F5' then begin s4:=160; s5:=0; end; if chn3='G5' then begin s4:=143; s5:=0; end; if chn3='A5' then begin s4:=127; s5:=0; end; if chn3='B5' then begin s4:=113; s5:=0; end; if chn3='C6' then begin s4:=107; s5:=0; end; if chn3='D6' then begin s4:=95; s5:=0; end; if chn3='E6' then begin s4:=85; s5:=0; end; if chn3='F6' then begin s4:=80; s5:=0; end; if chn3='G6' then begin s4:=71; s5:=0; end; if chn3='A6' then begin s4:=64; s5:=0; end; if chn3='B6' then begin s4:=57; s5:=0; end; if chn3='C7' then begin s4:=53; s5:=0; end; if chn3='D7' then begin s4:=48; s5:=0; end; if chn3='E7' then begin s4:=42; s5:=0; end; if chn3='F7' then begin s4:=40; s5:=0; end; if chn3='G7' then begin s4:=36; s5:=0; end; if chn3='A7' then begin s4:=32; s5:=0; end; if chn3='B7' then begin s4:=28; s5:=0; end; if chn3='C8' then begin s4:=27; s5:=0; end; if chn3='D8' then begin s4:=24; s5:=0; end; if chn3='E8' then begin s4:=21; s5:=0; end; if chn3='F8' then begin s4:=20; s5:=0; end; if chn3='G8' then begin s4:=18; s5:=0; end; if chn3='A8' then begin s4:=16; s5:=0; end; if chn3='B8' then begin s4:=14; s5:=0; end; if chn3='AB' then begin s4:=224; s5:=1; end; { A#3 } if chn3='AC' then begin s4:=240; s5:=0; end; { A#4 } if chn3='DB' then begin s4:=207; s5:=2; end; { D#3 } if chn3='DC' then begin s4:=104; s5:=1; end; { D#4 } if chn3='DD' then begin s4:=180; s5:=0; end; { D#5 } if chn3='FB' then begin s4:=93; s5:=2; end; { F#3 } if chn3='GB' then begin s4:=27; s5:=2; end; { G#3 } if chn3='GC' then begin s4:=13; s5:=1; end; { G#4 } end; if ShortNotes then begin for fr:=0 to 13 do begin sound(fr,0); end; end; if (s0>-1) or (s2>-1) or (s4>-1) then begin sound(6,Mixer); sound(7,Channels); sound(11,EfreqL); sound(12,EfreqH); sound(13,Envelope); end; { Mute command } if Chn1='MT' then VolA:=0; if Chn2='MT' then VolB:=0; if Chn3='MT' then VolC:=0; { do volume } if Chn1[1]='V' then begin if chn1[2]='G' then volA:=16 else tempstr:='$'+chn1[2]; Val(tempstr, volume, code); VolA:=volume; end; if Chn2[1]='V' then begin if chn2[2]='G' then volB:=16 else tempstr:='$'+chn2[2]; Val(tempstr, volume, code); VolB:=volume; end; if Chn3[1]='V' then begin if chn3[2]='G' then volC:=16 else tempstr:='$'+chn3[2]; Val(tempstr, volume, code); VolC:=volume; end; { Finally play the notes } if s0 > -1 then begin sound(8,VolA); sound(0,s0); sound(1,s1); end; if s2 > -1 then begin sound(9,VolB); sound(2,s2); sound(3,s3); end; if s4 > -1 then begin sound(10,VolC); sound(4,s4); sound(5,s5); end; end; Procedure InitMusic; begin SongPos:=1; ScorePos:=1; MusTimer:=0; sound(8,0); sound(9,0); sound(10,0); sound(0,0); sound(1,0); sound(2,0); sound(3,0); sound(4,0); sound(5,0); sound(6,0); sound(7,32+16+8+4+2+1); sound(13,0); sound(11,0); sound(12,0) end; Procedure PlayScore; begin if ScorePos=1 then begin sound(8,VolA); Sound(9,VolB); Sound(10,VolC); end; if MusTimer>Tempo then begin { gotoxy(1,18); writeln('Score: ', ScorePos, ' '); gotoxy(1,19); writeln('Pos : ', SongPos, ' '); } If (ScorePos>21) or (mScore[ScorePos]=$FF) then begin ScorePos:=1; end Else begin Ch1:=copy(PatternA[mScore[ScorePos]],SongPos,2); Ch2:=copy(PatternB[mScore[ScorePos]],SongPos,2); Ch3:=copy(PatternC[mScore[ScorePos]],SongPos,2); play(ch1,ch2,ch3); SongPos:=SongPos+2; if SongPos>Length(PatternA[mScore[ScorePos]])-1 then begin SongPos:=1; ScorePos:=ScorePos+1; end; End; MusTimer:=0; end; end; Var Vdp1 :Byte Absolute $f3e0; Vdp5 :Byte Absolute $f3e4; Vdp6 :Byte absolute $f3e5; Vdp8 :Byte Absolute $ffe7; Vdp11:Byte Absolute $ffea; SprTable : integer; { address of sprite table } PtrTable : integer; { address of pattern table } SprBuf : Array[0..127] of Byte; { sprite buffer } PtrBuf : Array[0..511] of byte; { sprite pattern buffer } type SprData= array[0..7] of byte; Procedure WritePattern(ptrnum: integer; var data:SprData); var fr:integer; begin for fr:=0 to 7 do PtrBuf[fr]:=data[fr]; end; Procedure _WrtVdp(VdpRegister,Value:Byte); begin Inline($F3/$3A/Value/ $D3/$99/ $3A/VdpRegister/ $F6/$80/ $D3/$99/$FB ); end; Procedure _WriteVram(VramBlockUsed:Byte; VramAddr,RamAddr,ByteCount:Integer); { VramBlocUsed = 0 = first 64 Kb 1 = second 64 Kb 2 = Expansion Vram 64 Kb } Var Expansion, AddrHi, AddrMid, AddrLo :Byte; begin If VramBlockUsed = 2 Then Expansion := $40 {Set the bit 6 (MXC) } Else Expansion := 0 ; {No expansion vram used} {AddrHi := Hi(VramAddr) Div $40;} AddrHi:=Hi(VramAddr) shr 6; If VramBlockUsed = 1 Then AddrHi := AddrHi + 4 ; {Set addr bit 16 in reg 14 = bit 2 } AddrLo := Lo(VramAddr); AddrMid := Hi(Vramaddr) And 63 ; Inline( $F3/$3A/ Expansion /$D3/$99/$3E/$2D/$F6/$80/$D3/$99/$3A/ AddrHi /$D3/ $99/$3E/$0E/$F6/$80/$D3/$99/$3A/ AddrLo /$00/$D3/$99/$3A/ AddrMid /$F6/ $40/$D3/$99/$2A/ RamAddr /$ED/$4B/ ByteCount /$7E/$D3/$98/$23/$0B/$79/ $B0/$20/$F7/ $F3/$3e/ 0 /$D3/$99/$3E/$2D/$F6/$80/$D3/$99/$FB ); end; Procedure SetSpritePattern(PatternNumber:Byte;Var PatternArray:SprData); Var VramAddr :Integer; A :SprData; Begin A := PatternArray; VramAddr := (Vdp6 * $800) + (PatternNumber * 8); _WriteVram(0,VramAddr,Addr(A),8); End; Procedure DisableSprites; {Get some speed to graphic operations. } begin Vdp8 := Vdp8 Or 2; _WrtVdp(8,Vdp8); end; Procedure EnableSprites; {Loose some speed in graphic operations. } Begin Vdp8 := Vdp8 And 253; _WrtVdp(8,Vdp8); End; Procedure SpriteSize8; {Default situation } Begin Vdp1 := Vdp1 And 253; _WrtVdp(1,Vdp1); End; Procedure SpriteSize16; Begin Vdp1 := Vdp1 Or 2; _WrtVdp(1,Vdp1); End; Procedure SpriteSizeNormal; {Default situation } Begin Vdp1 := Vdp1 And 254; _WrtVdp(1,Vdp1); End; Procedure SpriteSizeMagnified; Begin Vdp1 := Vdp1 Or 1; _WrtVdp(1,Vdp1); End; Procedure InitSprites; { must be called before using sprites } var f: byte; begin for f:=0 to 127 do SprBuf[f]:=255; for f:=0 to 511 do PtrBuf[f]:=0; SprTable:=((Vdp5 And 252) * $80)+(Vdp11 * $8000); PtrTable:=(Vdp6 * $800); end; Procedure UpdateSprites; { writes all sprites on vram sprite table } begin _WriteVram(0,SprTable,Addr(SprBuf),128); end; function Collision(x1,y1,w,h,x2,y2,w2,h2:byte):boolean; begin Collision:=false; if (x1x2) and (y1y2) then Collision:=true; end; Procedure DrawPatterns; { Draw all sprite patterns on PtrBuf to VRAM } begin _WriteVram(1,PtrTable,Addr(PtrBuf),512); end; Procedure ColorSprite(Number,color: byte; ccBit: boolean); { make sprite X color Y } Var cBuf : Array[0..15] Of Byte; fr : integer; begin for fr:=0 to 15 do if ccbit then cbuf[fr]:=64 or color else cbuf[fr]:=color; _WriteVram(1,SprTable-512+Number*16,Addr(cBuf),16); end; Procedure PutSprite(Number, X,Y, Pattern:byte); { writes a sprite on Buf } Var fr : integer; begin Number:=Number shl 2; SprBuf[Number ] :=Y-1; SprBuf[Number+1] :=X; SprBuf[Number+2] :=Pattern; end;