# Kernel # A Kernel draws a set of scanlines to the screen. component Kernel lines: 0..255 "Height of region in scanlines" bgcolor: 0..255 "Background color" end system SimpleKernel tempbytes 8 on preframe do once [Kernel] --- lda #192 ; TODO: numlines sec sbc ypos_ypos_b0+ent sta {{$5}}+ofs ldy hasbitmap_bitmap_b0+ent lda bitmap_bitmapdata_b0,y sec sbc {{$5}}+ofs sta {{$0}}+ofs lda bitmap_bitmapdata_b8,y sbc #0 sta {{$1}}+ofs ldy hascolormap_colormap_b0+ent lda colormap_colormapdata_b0,y sec sbc {{$5}}+ofs sta {{$2}}+ofs lda colormap_colormapdata_b8,y sbc #0 sta {{$3}}+ofs lda sprite_height_b0+ent sta {{$4}}+ofs lda ypos_ypos_b0+ent sta {{$5}}+ofs --- on preframe do once [Sprite,HasBitmap,HasColormap,HasYpos] -- {{@KernelSetup}} 0,0 {{@KernelSetup}} 1,6 -- on kernel do once [Kernel]: lda %{