{Fill.inc by K.Lammassaari/ACADEMY 1997} {Flood fills the given area restricted by line of given bordercolor staring from coordinates x,y .(BASIC command PAINT} {Syntax: Fill(x-coordinate,y-coordinate:Integer;color,bordercolor:Byte);} {Uses BASIC ROM routines. } {Descrition : - The memory $f55d - $f5ad is saved to heap. - The code is moved to $f580 and patched to use MSXDOS ENASLT-routine, which operates from page 3 and allows to handle the page 0 .(BIOS ENASLT crashes if used to turn page 0.) - parameters are pathced to the BASIC line (the parameter part) at &f55d. - HL is set to point at $f55d, the code is called and the memory is restored from stack. } Procedure Fill(x,y:Integer;color,bordercolor:Byte); Const Code :Array[0..40] Of Byte = ($f3, $3A,$C1,$FC,$F5,$21,$0,$0,$CD,$24,$0,$F1,$26,$40,$CD,$24,$0, $21,$5D,$F5,$CD,$C5,$59, $3A,$41,$F3,$26,$0,$CD,$24,$0,$3A,$42,$F3,$26,$40,$CD,$24,$0,$FB,$c9 ); BasicLine :Array[0..15] Of Byte = (40,$0c,0,0,44,$0c,0,0,41,44,$0f,0, 44,$0f,0,0); Var i :Byte; c :Array[0..40] of Byte Absolute $f580 ; b :Array[0..15] Of Byte Absolute $f55d; xc :Integer Absolute $f55f; yc :Integer Absolute $f563; co :Byte Absolute $f568; bc :Byte Absolute $f56b; store :^byte; EnasltAddr :Integer Absolute $0025; Patch :Integer Absolute $f59d; Begin Inline($f3); Getmem(Store,80); Move(b,Store^,80); Move(code,c,41); Patch := EnaSltAddr; Move(BasicLine,b,16); xc := x; yc := y; co := Color; bc := BorderColor; Inline ($cd/$80/$f5 ); Move(Store^,b,80); FreeMem(Store,80); End;