very very early stage of VBE support.

Raw() not implemented yet
This commit is contained in:
xmm15 2020-02-19 16:30:04 -06:00
parent 2b5bcc8b71
commit 9063280cc5
15 changed files with 325 additions and 243 deletions

Binary file not shown.

Binary file not shown.

View file

@ -4,7 +4,7 @@ U8 a[60]={0,127,0,1,255,192,3,255,224,3,231,224,
7,217,240,7,223,240,7,217,240,3,231,224,
3,255,224,3,255,224,2,255,160,1,127,64,
1,62,64,0,156,128,0,156,128,0,73,0,0,73,0,
0,62,0,0,62,0,0,28,0};
 0,62,0,0,62,0,0,28,0};
U0 Balloon()
{

View file

@ -88,6 +88,14 @@ Bool MyPutKey(I64 ch,I64 sc)
TimeIns;
}
return TRUE;
case SC_DELETE:
if(sc & SCF_SHIFT) {
if(sc & SCF_KEY_DESC)
KeyDescSet("Cmd/Soft Reboot");
else
BootRAM;
}
return TRUE;
}
break;
case 'a':

Binary file not shown.

View file

@ -63,7 +63,7 @@ U0 SysGlobalsInit()
Seg2Linear(&sys_vbe_info.product_name);
Seg2Linear(&sys_vbe_info.product_revision);
Seg2Linear(SYS_FONT_PTR);
sys_vbe_info.software_revision = Bcd2Binary(sys_vbe_info.software_revision);
sys_vbe_info.software_revision = Bcd2Binary(sys_vbe_info.software_revision);
}
debug.fun_seg_cache=CAlloc(FUN_SEG_CACHE_SIZE*sizeof(CFunSegCache));
@ -71,6 +71,36 @@ U0 SysGlobalsInit()
}
U0 SysGrInit()
{
I64 i, j;
text.font = MAlloc(sizeof(U64) * 256);
MemCopy(text.font, *SYS_FONT_PTR(U32), sizeof(U64) * 256);
for (i = 0; i < 256; i++)
for (j = 0; j < 8; j++)
text.font[i].u8[j] = rev_bits_table[text.font[i].u8[j]];
text.aux_font = sys_font_std;
text.font['' - 1] = text.aux_font['' - 1]; //Shift-space
text.font[10] = text.aux_font[10]; //"Return" symbol
text.font[255] = text.aux_font[255]; //auxillary block character
text.border_chars[2] (I64)='ÄͳºÚÉ¿»';
text.border_chars[10](U32)='ÀÈÙ¼';
text.cols = sys_vbe_mode.width / FONT_WIDTH;
text.rows = sys_vbe_mode.height / FONT_HEIGHT;
text.screen_size = sys_vbe_mode.width * sys_vbe_mode.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_vbe_mode.framebuffer;
MemSetU32(text.fb_alias, BLACK32, text.screen_size);
text.vga_alias = CAlloc(text.rows * text.cols * 8);
text.vga_text_alias = CAlloc(text.rows * text.cols * 2);
}
/*U0 SysGrInit()
{
I64 i, j;
text.font = MAlloc(256 * 8); //256 U64s
@ -101,7 +131,7 @@ U0 SysGrInit()
MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT>>3);
text.raw_screen_image=CAlloc(GR_WIDTH*GR_HEIGHT/8);
}
}
}*/
U0 TimerInit()
{//See $LK,"::/Doc/PIT.DD",A="FI:::/Doc/PIT.DD"$.

View file

@ -56,7 +56,7 @@ SYS_VBE_FINAL_MODE:: DU8 sizeof(CVBEMode) DUP(0);
SYS_VBE_FINAL:: DU16 0; //mode number of final mode set
#assert $$-SYS_KERNEL==sizeof(CKernel)-sizeof(CBinFile)
TEMP_VBE_MODE: DU8 sizeof(CVBEMode) DUP(0);
TEMP_VBE_MODE: DU8 sizeof(CVBEMode) DUP(0);
MAX_VBE_MODE: DU8 sizeof(CVBEModeShort) DUP(0);
MAX_SCREEN_HEIGHT: DU16 0;
@ -206,20 +206,20 @@ GET_IP: POP BX
JNE @@10 //if called failed
//Set the mode; call takes mode number in BX
// MOV AX, 0x4F02
// MOV BX, CX
// INT 0x10
// CMP AX, 0x004F
// JNE @@10
MOV AX, 0x4F02
MOV BX, CX
INT 0x10
CMP AX, 0x004F
JNE @@10
MOV AX,0x4F02
MOV BX,0x12 //640x480 16 color
#exe {
if (!kernel_config->opts[CONFIG_TEXT_MODE])
StreamPrint("INT 0x10"); //Enable VGA
};
CMP AX,0x004F
JNE @@10 //Jmp if fail
// MOV AX,0x4F02
// MOV BX,0x12 //640x480 16 color
//#exe {
// if (!kernel_config->opts[CONFIG_TEXT_MODE])
// StreamPrint("INT 0x10"); //Enable VGA
//};
// CMP AX,0x004F
// JNE @@10 //Jmp if fail
BTS U32 [SYS_RUN_LEVEL],RLf_VESA
@@10:

File diff suppressed because one or more lines are too long

View file

@ -508,7 +508,7 @@ class CVBEModeShort
#help_index "Boot"
class CKernel
{//Must match $LK,"OSStartUp",A="FF:::/Kernel/KStart16.CC,MEM_BOOT_BASE"$
 CBinFile h;
CBinFile h;
U32 jmp,
boot_src,
boot_blk,
@ -3721,8 +3721,9 @@ public class CTextGlobals
{
I64 raw_col,raw_flags;
U8 *raw_screen_image;
U32 *raw_screen, *fb_alias;
I64 rows,cols; //Use TEXT_ROWS,TEXT_COLS
U64 *font,*aux_font;
U64 *font,*aux_font,screen_size, buffer_size;
U8 *vga_alias,*vga_text_alias;
U8 border_chars[16];
};

View file

@ -1710,12 +1710,12 @@ U0 OSTestSuite()
TS("ATARep"); XTalkWait(task,"ATARep;\npSleep(750);\n");
TS("HashDepthRep"); XTalkWait(task,"HashDepthRep(zenith_task->hash_table);Sleep(750);\n");
TS("Who"); XTalkWait(task,"Who;Sleep(750);\n");
 TS("DriveRep"); XTalkWait(task,"DriveRep;Sleep(750);\n");
TS("DriveRep"); XTalkWait(task,"DriveRep;Sleep(750);\n");
TS("TaskRep"); XTalkWait(task,"TaskRep;Sleep(750);\n");
TS("VideoRep"); XTalkWait(task, "VideoRep;Sleep(750)\n");
TS("VideoRep"); XTalkWait(task, "VideoRep;Sleep(750);\n");
DeathWait(&task,TRUE);
ProgressBarsReset("ZenithOS/OSTestSuite");
 ProgressBarsReset("ZenithOS/OSTestSuite");
"Elapsed Time:%5.3f\n",tS-ts_t0;
}

Binary file not shown.

View file

@ -34,7 +34,7 @@ public class CGrGlobals
circle_hi[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM];
#define GR_SCREEN_ZOOM_MAX 8
U8 *screen_zoom_tables[GR_SCREEN_ZOOM_MAX+1];
U8 *screen_zoom_tables[GR_SCREEN_ZOOM_MAX+1], *screen_cache;
I64 screen_zoom,sx,sy;
//When zoomed, this keeps the mouse centered.
@ -42,14 +42,18 @@ public class CGrGlobals
hide_row,hide_col;
} gr;
public CBGR24 gr_palette[COLORS_NUM];
//See $LK,"RLf_VESA",A="FF:::/Kernel/KStart16.CC,RLf_VESA"$
//See $LK,"SysGrInit",A="MN:SysGrInit"$()
//Allows consts to be used instead of vars.
HashPublic("GR_WIDTH",HTT_DEFINE_STR);;
DefinePrint("GR_WIDTH", "%d", sys_vbe_mode.width);
HashPublic("GR_HEIGHT",HTT_DEFINE_STR);;
DefinePrint("GR_HEIGHT", "%d", sys_vbe_mode.height);
#help_index "Char;TextBase Layer/Char"
DefinePrint("TEXT_ROWS","%d",text.rows);;;
HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;;
DefinePrint("TEXT_COLS","%d",text.cols);;;
HashPublic("TEXT_COLS",HTT_DEFINE_STR);;;
DefinePrint("TEXT_ROWS","%d",text.rows);;
HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;
DefinePrint("TEXT_COLS","%d",text.cols);;
HashPublic("TEXT_COLS",HTT_DEFINE_STR);;

View file

@ -184,6 +184,8 @@ U0 GrInit2()
gr.to_8_bits =MAlloc(256*sizeof(I64));
gr.to_8_colors=MAlloc(256*sizeof(I64));
gr.screen_cache = MAlloc(sys_vbe_mode.width * sys_vbe_mode.height);

gr.text_base=CAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U32));
gr.vga_text_cache=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
gr.win_uncovered_bitmap=CAlloc(65536/8);

View file

@ -79,11 +79,16 @@ public CBGR48 gr_palette_gray[COLORS_NUM]={
0x888888888888,0x999999999999,0xAAAAAAAAAAAA,0xBBBBBBBBBBBB,
0xCCCCCCCCCCCC,0xDDDDDDDDDDDD,0xEEEEEEEEEEEE,0xFFFFFFFFFFFF};
public CBGR24 gr32_palette_gray[COLORS_NUM] = {
0x000000, 0x111111, 0x222222, 0x333333, 0x444444, 0x555555, 0x666666, 0x777777,
0x888888, 0x999999, 0xAAAAAA, 0xBBBBBB, 0xCCCCCC, 0xDDDDDD, 0xEEEEEE, 0xFFFFFF
};
public U0 GrPaletteGet(CBGR48 *bgr48)
{//16 colors
I64 i;
for (i=0;i<COLORS_NUM;i++)
bgr48[i]=GrPaletteColorGet(i);
 bgr48[i]=GrPaletteColorGet(i);
}
public U0 GrPaletteSet(CBGR48 *bgr48)

View file

@ -395,6 +395,42 @@ U0 GrUpdateVGAGraphics()
}
}
U0 GrCalcScreenUpdates()
{
U16 *screen = gr.dc2->body, *last_screen = gr.screen_cache;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
for (i = 0; i < diffs_size; i++)
{
if (screen[i] != last_screen[i])
dst[i] = src[i];
}
MemCopy(gr.screen_cache, gr.dc2->body, diffs_size * 2);
}
U0 GrUpdateScreen32()
{
U64 size, *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++ = gr32_palette_gray[*src++ & 0xFF] | gr32_palette_gray[*src++ & 0xFF] << 32;
GrCalcScreenUpdates;
if (LBtr(&sys_semas[SEMA_FLUSH_VGA_IMAGE],0))
MemCopy(text.fb_alias, text.raw_screen, text.buffer_size);
}
U0 GrUpdateScreen()
{//Called by the Window Manager $LK,"HERE",A="FF:::/Zenith/WinMgr.CC,GrUpdateScreen"$, 30 times a second.
CDC *dc;
@ -419,5 +455,6 @@ U0 GrUpdateScreen()
DCBlotColor4(gr.dc1->body,gr.dc2->body,gr.dc_cache->body,
gr.dc2->height*gr.dc2->width_internal>>3);
GrUpdateVGAGraphics;
GrUpdateScreen32;
}
}