mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Merge 38c41e551a
into a95d5559de
This commit is contained in:
commit
44b37bdb28
10 changed files with 51 additions and 32 deletions
|
@ -74,6 +74,12 @@ else
|
|||
sudo modprobe nbd
|
||||
[ ! -d $TMPMOUNT ] && mkdir $TMPMOUNT
|
||||
case $1 in
|
||||
flush)
|
||||
mount_vdisk
|
||||
sudo blockdev --flushbufs /dev/nbd0
|
||||
sudo dosfsck -w -r -l -v -t /dev/nbd0
|
||||
umount_vdisk
|
||||
;;
|
||||
diff)
|
||||
mount_vdisk
|
||||
diff -x *.MAP --color=always -r ../src/ $TMPMOUNT/ | less -R -p "diff -x.*|Only in.*"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
I0 DrawPixel(I64 x, I64 y, CBGR24 color)
|
||||
{
|
||||
text.fb_alias[x + y * GR_WIDTH] = color;
|
||||
text.fb_alias[x + y * sys_framebuffer_width] = color;
|
||||
}
|
||||
|
||||
I0 Color32Demo()
|
||||
|
|
|
@ -32,12 +32,12 @@ U0 PaintGlobalsInit()
|
|||
|
||||
I0 DrawImagePixel(I64 x, I64 y, CBGR24 color)
|
||||
{
|
||||
paint.fb[x + y * GR_WIDTH] = color;
|
||||
paint.fb[x + y * sys_framebuffer_width] = color;
|
||||
}
|
||||
|
||||
I0 DrawScreenPixel(I64 x, I64 y, CBGR24 color)
|
||||
{
|
||||
text.fb_alias[x + y * GR_WIDTH] = color;
|
||||
text.fb_alias[x + y * sys_framebuffer_width] = color;
|
||||
}
|
||||
|
||||
I0 DrawScreenChar(I64 x, I64 y, I64 char)
|
||||
|
@ -136,7 +136,7 @@ U0 PaintLoadImage()
|
|||
|
||||
U32 PaintImagePeek(I64 x, I64 y)
|
||||
{
|
||||
return paint.fb[x + y * GR_WIDTH];
|
||||
return paint.fb[x + y * sys_framebuffer_width];
|
||||
}
|
||||
|
||||
I0 Paint32()
|
||||
|
@ -176,7 +176,7 @@ I0 Paint32()
|
|||
// draw the image where the brush was last covering it
|
||||
for (i = paint.last_x; i < paint.last_x + paint.last_thick; i++)
|
||||
for (j = paint.last_y; j < paint.last_y + paint.last_thick; j++)
|
||||
DrawScreenPixel(i, j, paint.fb[i + j * GR_WIDTH]);
|
||||
DrawScreenPixel(i, j, paint.fb[i + j * sys_framebuffer_width]);
|
||||
|
||||
// draw the brush on the screen
|
||||
DrawScreenBrush(mouse.pos.x, mouse.pos.y, paint.color, paint.thick);
|
||||
|
@ -193,7 +193,7 @@ I0 Paint32()
|
|||
// draw the image where the color strings where covering it
|
||||
for (i = 0; i < 3 * FONT_HEIGHT; i++)
|
||||
for (j = 0; j < 12 * FONT_WIDTH; j++)
|
||||
DrawScreenPixel(j, i, paint.fb[j + i * GR_WIDTH]);
|
||||
DrawScreenPixel(j, i, paint.fb[j + i * sys_framebuffer_width]);
|
||||
|
||||
// draw the color strings on screen
|
||||
DrawScreenStr(0, 0 * FONT_HEIGHT, str_r);
|
||||
|
|
|
@ -8,7 +8,9 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
|||
*/
|
||||
I64 i, row, col, x, y;
|
||||
U32 *framebuffer;
|
||||
U64 ch_bitmap;
|
||||
U64 ch_bitmap, fb_width_from_pitch;
|
||||
|
||||
fb_width_from_pitch = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
|
||||
|
||||
if (!(text.raw_flags & RAWF_SHOW_DOLLAR))
|
||||
{
|
||||
|
@ -60,17 +62,17 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
|||
{//Scroll screen down
|
||||
|
||||
MemCopy(text.fb_alias,
|
||||
text.fb_alias + sys_framebuffer_width * FONT_HEIGHT,
|
||||
(text.screen_size - sys_framebuffer_width * FONT_HEIGHT) * sizeof(U32));
|
||||
text.fb_alias + fb_width_from_pitch * FONT_HEIGHT,
|
||||
(text.screen_size - fb_width_from_pitch * FONT_HEIGHT) * sizeof(U32));
|
||||
|
||||
MemSetU32(text.fb_alias + text.screen_size - sys_framebuffer_width * FONT_HEIGHT, BLACK32, sys_framebuffer_width * FONT_HEIGHT);
|
||||
MemSetU32(text.fb_alias + text.screen_size - fb_width_from_pitch * FONT_HEIGHT, BLACK32, fb_width_from_pitch * FONT_HEIGHT);
|
||||
text.raw_col -= text.cols ;
|
||||
row = text.rows - 1;
|
||||
}
|
||||
x = col * FONT_WIDTH;
|
||||
y = row * FONT_HEIGHT;
|
||||
ch_bitmap = text.font[ch & 0xFF];
|
||||
framebuffer = text.fb_alias + sys_framebuffer_width * y + x;
|
||||
framebuffer = text.fb_alias + fb_width_from_pitch * y + x;
|
||||
|
||||
PUSHFD
|
||||
CLI
|
||||
|
@ -81,7 +83,7 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
|||
else
|
||||
*framebuffer++ = BLACK32;
|
||||
if (i & (FONT_WIDTH - 1) == FONT_WIDTH - 1)
|
||||
framebuffer += sys_framebuffer_width - FONT_WIDTH;
|
||||
framebuffer += fb_width_from_pitch - FONT_WIDTH;
|
||||
ch_bitmap >>= 1;
|
||||
}
|
||||
POPFD
|
||||
|
|
|
@ -14,7 +14,7 @@ U8 *rev_bits_table; //Table with U8 bits reversed
|
|||
CDate local_time_offset;
|
||||
F64 *pow10_I64,
|
||||
sys_os_version = 2.03;
|
||||
U64 sys_os_version_sub = 118;
|
||||
U64 sys_os_version_sub = 119;
|
||||
U8 *sys_os_version_str;
|
||||
U8 *sys_os_version_full;
|
||||
U8 *sys_os_version_nice;
|
||||
|
|
|
@ -91,7 +91,7 @@ U0 SysGrInit()
|
|||
text.cols = sys_framebuffer_width / FONT_WIDTH;
|
||||
text.rows = sys_framebuffer_height / FONT_HEIGHT;
|
||||
|
||||
text.screen_size = sys_framebuffer_width * sys_framebuffer_height;
|
||||
text.screen_size = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8) * sys_framebuffer_height;
|
||||
text.buffer_size = text.screen_size * 4; //buffer for 32-bit, but only 16 colors now.
|
||||
text.raw_screen = CAlloc(text.buffer_size);
|
||||
text.fb_alias = sys_framebuffer_addr;
|
||||
|
|
|
@ -1272,7 +1272,7 @@ public class CDocBin
|
|||
#assert !($$ & 7)
|
||||
};
|
||||
|
||||
#define DOC_SCROLL_SPEED 8
|
||||
#define DOC_SCROLL_SPEED 6
|
||||
|
||||
#define DOCSS_NORMAL 0
|
||||
#define DOCSS_SINGLE_QUOTE 1
|
||||
|
|
|
@ -214,7 +214,8 @@ public CDC *DCNew(I64 width, I64 height, CTask *task=NULL, Bool null_bitmap=FALS
|
|||
res->win_task = task;
|
||||
res->mem_task = task;
|
||||
res->width = width;
|
||||
res->width_internal = (width + 7) & ~7;
|
||||
// res->width_internal = (width + 7) & ~7;
|
||||
res->width_internal = width & ~7;
|
||||
res->height = height;
|
||||
if (null_bitmap)
|
||||
res->flags |= DCF_DONT_DRAW;
|
||||
|
|
|
@ -47,7 +47,7 @@ public CBGR24 gr_palette[COLORS_NUM];
|
|||
//See $LK,"SysGrInit",A="MN:SysGrInit"$()
|
||||
//Allows consts to be used instead of variables.
|
||||
HashPublic("GR_WIDTH", HTT_DEFINE_STR);;
|
||||
DefinePrint("GR_WIDTH", "%d", sys_framebuffer_width);
|
||||
DefinePrint("GR_WIDTH", "%d", sys_framebuffer_width & ~7);
|
||||
HashPublic("GR_HEIGHT", HTT_DEFINE_STR);;
|
||||
DefinePrint("GR_HEIGHT", "%d", sys_framebuffer_height);
|
||||
|
||||
|
|
|
@ -359,42 +359,52 @@ U0 DCBlotColor8(CDC *dc, CDC *img)
|
|||
|
||||
U0 GrCalcScreenUpdates()
|
||||
{
|
||||
U16 *screen, *last_screen = gr.screen_cache;
|
||||
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
|
||||
U8 *screen, *last_screen = gr.screen_cache;
|
||||
U32 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT;
|
||||
U64 x, y, w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
|
||||
|
||||
if (gr.screen_zoom == 1)
|
||||
screen = gr.dc2->body;
|
||||
else
|
||||
screen = gr.zoomed_dc->body;
|
||||
|
||||
for (i = 0; i < diffs_size; i++)
|
||||
for (y = 0; y < GR_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < GR_WIDTH; x++)
|
||||
{
|
||||
i = x + y * GR_WIDTH;
|
||||
if (screen[i] != last_screen[i])
|
||||
dst[i] = src[i];
|
||||
{
|
||||
dst = text.fb_alias + x + y * w;
|
||||
src = text.raw_screen + x + y * w;
|
||||
*dst = *src;
|
||||
}
|
||||
MemCopy(gr.screen_cache, screen, diffs_size * 2);
|
||||
}
|
||||
}
|
||||
MemCopy(gr.screen_cache, screen, diffs_size);
|
||||
}
|
||||
|
||||
U0 GrUpdateScreen32()
|
||||
{
|
||||
U64 size, *dst;
|
||||
U64 x, y, wi, yi, w = sys_framebuffer_pitch / (sys_framebuffer_bpp / 8);
|
||||
U32 *dst;
|
||||
U8 *src;
|
||||
|
||||
if (gr.screen_zoom == 1)
|
||||
{
|
||||
src = gr.dc2->body;
|
||||
size = src + gr.dc2->height * gr.dc2->width_internal;
|
||||
}
|
||||
else
|
||||
{
|
||||
GrZoomInScreen;
|
||||
src = gr.zoomed_dc->body;
|
||||
size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal;
|
||||
}
|
||||
dst = text.raw_screen;
|
||||
while (src < size) //draw 2 pixels at a time
|
||||
*dst++ = gr_palette[*src++ & 0xFF] | gr_palette[*src++ & 0xFF] << 32;
|
||||
|
||||
for (y = 0; y < GR_HEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < GR_WIDTH; x++)
|
||||
{
|
||||
dst = text.raw_screen + x + y * w;
|
||||
*dst = gr_palette[src[x + y * GR_WIDTH] & 0xFF];
|
||||
}
|
||||
}
|
||||
|
||||
GrCalcScreenUpdates;
|
||||
|
||||
|
|
Loading…
Reference in a new issue