branch off of gfx-wp-fun, revert to master KGlobals, GrDC, GrScreen, ZXERep

This commit is contained in:
GutPuncher 2023-10-25 23:24:46 -04:00
parent 4c84a83f32
commit b046389217
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7
4 changed files with 9 additions and 121 deletions

View file

@ -13,7 +13,7 @@ CTask *sys_winmgr_task,
U8 *rev_bits_table; //Table with U8 bits reversed
CDate local_time_offset;
F64 *pow10_I64,
sys_os_version = 2.04;
sys_os_version = 2.03;
CAutoCompleteDictGlobals acd;
CAutoCompleteGlobals ac;

View file

@ -214,9 +214,7 @@ 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 / 8 * 8;
// res->width_internal = width;
res->width_internal = (width + 7) & ~7;
res->height = height;
if (null_bitmap)
res->flags |= DCF_DONT_DRAW;

View file

@ -34,7 +34,7 @@ U0 GrUpdateTaskWin(CTask *task)
if (gr.fp_wall_paper)
(*gr.fp_wall_paper)(task);
}
/*else*/ if (!(task->win_inhibit & WIF_SELF_DOC))
else if (!(task->win_inhibit & WIF_SELF_DOC))
DocUpdateTaskDocs(task);
if (TaskValidate(task))
{
@ -360,45 +360,25 @@ U0 DCBlotColor8(CDC *dc, CDC *img)
U0 GrCalcScreenUpdates()
{
U16 *screen, *last_screen = gr.screen_cache;
U64 i, j, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
U64 w, d;//, p;
w = GR_WIDTH;
// p = (GR_WIDTH + 7) & ~7;
d = GR_WIDTH / 8 * 8;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
if (gr.screen_zoom == 1)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
for (i = j = 0; i < diffs_size; i++, j++)
for (i = 0; i < diffs_size; i++)
{
if (j != 0 && j % (d/2) == 0 && d != w)
{
j += (w - d) / 2;
}
// if (screen[j] != last_screen[j])
if (screen[i] != last_screen[i])
// dst[i] = src[i];
dst[j] = src[j];
dst[i] = src[i];
}
MemCopy(gr.screen_cache, screen, diffs_size * 2);
}
U0 GrUpdateScreen32()
{
// U64 size, *dst;
U64 size;
U32 *dst;
U64 size, *dst;
U8 *src;
U64 w, i, p, d;
w = GR_WIDTH;
i = 0;
p = (GR_WIDTH + 7) & ~7;
d = GR_WIDTH / 8 * 8;
if (gr.screen_zoom == 1)
{
@ -412,19 +392,8 @@ U0 GrUpdateScreen32()
size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal;
}
dst = text.raw_screen;
while (src < size)
{
*dst++ = gr_palette[*src++ & 0xFF];
i++;
if (i == d && d != w)
{
i = w - d;
dst += i;
i = 0;
}
}
while (src < size) //draw 2 pixels at a time
*dst++ = gr_palette[*src++ & 0xFF] | gr_palette[*src++ & 0xFF] << 32;
GrCalcScreenUpdates;

View file

@ -32,12 +32,6 @@ public Bool ZXERep(U8 *filename)
Bool res = FALSE;
CZXE *zxe;
CHashExport *saved_hash_ptr = NULL;
Bool unlock_doc = DocLock(Fs->put_doc);
CQueueD3I32 *patch_offsets_queue = CAlloc(sizeof(CQueueD3I32));
CQueueD3I32 *patch; // x == i
I32 t;
QueueInit(patch_offsets_queue);
fbuf = ExtDefault(filename, "ZXE");
@ -64,22 +58,11 @@ public Bool ZXERep(U8 *filename)
" MODULE_ALIGN:%X\n", 1 << zxe->module_align_bits;
ptr = zxe(U8 *) + zxe->patch_table_offset;
progress1_max = size - zxe->patch_table_offset;
progress1 = 0;
while (etype = *ptr++)
{
progress1++;
saved_hash_ptr = NULL;
i = *ptr(U32 *)++;
progress1 += 4;
sptr = ptr;
ptr += StrLen(sptr) + 1;
progress1 += StrLen(sptr) + 1;
patch = CAlloc(sizeof(CQueueD3I32));
patch->p.x = i;
QueueInsert(patch, patch_offsets_queue);
"$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_ZXE_FILE_TYPES", sptr, i;
switch (etype)
{
@ -88,37 +71,12 @@ public Bool ZXERep(U8 *filename)
saved_hash_ptr = HashFind(sptr, Fs->hash_table, HTG_ALL);
if (!saved_hash_ptr)
"Unresolved Reference:%s\n", sptr;
else
"%s", sptr;
break;
case IET_REL32_EXPORT:
"$$TR,\"ASM\"$$\n$$ID,2$$";
Un(i + zxe(U8 *) + sizeof(CZXE));
"\n$$ID,-2$$\n";
"ZXERep REL32_EXPORT";
break;
case IET_IMM32_EXPORT:
"ZXERep IMM32_EXPORT";
break;
case IET_REL64_EXPORT:
"ZXERep REL64_EXPORT";
break;
case IET_IMM64_EXPORT:
"ZXERep IMM64_EXPORT";
break;
case IET_MAIN:
"ZXERep IET_MAIN";
break;
case IET_END:
"ZXERep IET_END";
break;
case IET_ABS_ADDR:
'\n';
for (j = 0; j < i; j++)
"%X ", *ptr(U32 *)++;
progress1 += j * 4;
break;
case IET_CODE_HEAP:
@ -126,7 +84,6 @@ public Bool ZXERep(U8 *filename)
"Size:%X\n", *ptr(U32 *)++;
for (j = 0; j < i; j++)
"%X ", *ptr(U32 *)++;
progress1 += 4 + j * 4;
break;
case IET_DATA_HEAP:
@ -134,39 +91,10 @@ public Bool ZXERep(U8 *filename)
"Size:%X\n", *ptr(I64 *)++;
for (j = 0; j < i; j++)
"%X ", *ptr(U32 *)++;
progress1 += 8 + j * 4;
break;
default:
"ZXERep missing IET:%d", etype;
break;
}
'\n';
}
progress2_max = QueueSize(patch_offsets_queue);
progress3_max = QueueSize(patch_offsets_queue);
progress3 = 0;
br_patchloop:
progress2 = 0;
patch = patch_offsets_queue->next;
while (patch != patch_offsets_queue)
{
"%X ?--> %X", patch->p.x, patch->next->p.x;
if (patch->next != patch_offsets_queue && patch->p.x > patch->next->p.x)
{
t = patch->p.x;
patch->p.x = patch->next->p.x;
patch->next->p.x = t;
if (progress3 < progress2)
progress3++;
goto br_patchloop;
}
patch = patch->next;
progress2++;
}
"\n";
res = TRUE;
Free(absname);
br_done2:
@ -174,12 +102,5 @@ br_done2:
br_done1:
Free(fbuf);
if (unlock_doc)
DocUnlock(Fs->put_doc);
progress1_max = 0;
progress2_max = 0;
progress3_max = 0;
return res;
}