From 320be82ab5e414d1b771b295403218b614ed9d13 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 13 Apr 2017 15:12:13 -0500 Subject: [PATCH] p16 is being worked on a bunch by me wwww [16_ca needs huge amounts of work and I should remember what needs to be done soon][OpenVGMFile needs to be ported to 16_snd.c]going to port rest of code to borland c some time so we can use the core components of id engine here [going to add 16_us.c eventually but the debug system and CA_ PM_ and MM_ usage is priority now]older zcroll renamed to xcroll][zcroll is now the pre menu game loop system with PROPER data usage with CAMMPM] MM_ShowMemory is quite buggy on real machines. i need to debug it and fix added a struct printer[gvar.mm is FUCKING HUGE 14402 bytes FAT\!]16_rf now compiles BT UNKNOWN ON WHAT IT DOSE\! text box creates a ghost because page 1 do not have bg info thus it is stored and saved.... wwww fizzfade being worked on and no idea how to make it work... --- NO_NAME.GIF | Bin 2703 -> 0 bytes data/G.PAL | Bin 768 -> 768 bytes src/bakapi.c | 51 +++++++++----- src/lib/16_mm.c | 2 +- src/lib/16_tail.c | 164 ++++++++++++++------------------------------- src/lib/16_tail.h | 2 +- src/lib/16_tail_.c | 1 + src/lib/16_tdef.h | 1 + src/lib/16_vl.c | 65 +++++++++++++++--- src/lib/16_vl.h | 4 +- src/lib/16_vl_1.c | 10 +-- src/lib/bakapee.c | 161 +++++++++++++++++++++++++++++--------------- src/lib/bakapee.h | 2 +- src/palbomb.c | 2 +- src/palettec.c | 2 +- src/palettel.c | 2 +- 16 files changed, 268 insertions(+), 201 deletions(-) delete mode 100755 NO_NAME.GIF diff --git a/NO_NAME.GIF b/NO_NAME.GIF deleted file mode 100755 index a2bb4e902ca040e94ef24e832dff72040b8a9d8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2703 zcmeIx`%lyN8VB&s!vUf|h%-Ps=a?F(fXJKyPBlAZ8t4rq&H!OfInF=@M6wwmo!MdP zD8qtG9c2}v+9f@(r^wY|O{@nzwxxT{_CAo6U@L1cG_ z&D4v?;lDR_N-3QzF}UL3!fR4yzgbr z>HWRyGkrfA=jHtZ)57rGeV=6v^jS3GN3mBF1J7-`iFR~L#tWgtIL$9wP`u~|P3n>R z-p|et4!CXlN#>RD!55pLStDyXKQy?#>9QFY#)pP>R$q*XzDvbiF)>sk>yX*Sdj3;~IY=HFmw{T~^Whv*~>1dhcwRab2LUirwg2 zZYbJ#uBR|JgloOVjehf3tZBeLRb+bM(lSkhTTY{C2oexy9`*|_HopvvW|?0FC9Ro9 zLet_bqX)8!Ew3XASeCJa$Tve+h1*0F4g zGvJzSJSE_`ed1jB4f`8JG~50bleBK1%uGA(cy}@ThU0xs0oyTkseIj`%)=jdPG2M5 zaDKp2*-lllVBI-WDmo6%-csHG=PGn;aQ-&vT?ZE`1L9rkd*LOn#p-B|Yl)Dw;nLKn z#k-duXP3BF8VfjXZBzM%TSvynd-NT|63;4)%JCRjf(?(6CyL)(>rs|$uJ`FUn;Qe* z#-?dF;KY`BH2mh4MI6oDvI0q_E!#xeiEaD4?3>$;=>qPybGF>H4XW`cc3jKEn>%hj zmAm6v6PR{3&7u?DExYojciW}odUv)!)9w!pB0~ZY!+W6S%0LWxPq=v4A8!67ltA{2 zM!ejcYrYc!ko}XyFGFzVyOBYyfoX_W`$^_|Fih*-Z1Jlwq50PYLTgX~Vg#x(S0w|j zA?4zcLmo3eC8#abi${zehFYo-n6~{y@n{s>@>?dM?En?=IwsdrlLNGc3B<4CahCge zLG2MD#Mnuag@DDhLzUvOM4_d&l+b=qhY-P4mbwa{{SYV?edVz{s0`|e3_yy%hFa^Z zF&&4)CE`@L_4j&0$I)n{1eI%j*a&n)B}pV1IO`*FP$w)6DZN0lKBi$hW3naEETQ!e z9-%X?04d8=SsVI*&iHbP?6Sv791fx+;E}*psI5_qp`0X2fPA>^&j|wM6cs5i%(aoG z0ZO7kA}_(&o~VPU$s(lU2a>HxkDsmDWgEZIK-6&_}C&@l2a85os zn2k+CtKO2FJ+yRoVYW;)C3HUH)v}8V&@(Ep%Gui|XP1=AX68Lk!Ei9A6px-=f`WbG zbj}Y%*{l{0KA))N+@hlA47s3iTFxmG$mTY1V81$;TOmTvTS?%6KAnqG%I2Ly@P)aS zds~NI@TkB+mz?`EC|lU^fJ2ZFUS$AAz2_6xa9{@SPB@_UKka%MTF1K=jal6Lt?N~U zf>)IUEQb8#8i@?)s!qc!?SJALg=KWrWCKfK{jS#ubzOu4j0QU68cSAm)s+L9Lz^y9 zN=SD-90) @@ -327,9 +348,9 @@ pee: break; default: key=0; - clrscr(); //added to clear screen wwww break; } + clrscr(); //added to clear screen wwww } } #if 0 diff --git a/src/lib/16_mm.c b/src/lib/16_mm.c index ab517893..2f032490 100755 --- a/src/lib/16_mm.c +++ b/src/lib/16_mm.c @@ -1266,7 +1266,7 @@ void MM_ShowMemory(global_game_variables_t *gvar) sdword end,owner; byte scratch[160],scratch0[4096],str[16]; - VL_SetLineWidth(40, &gvar->video.ofs); + VL_SetLineWidth(40, gvar); temp = gvar->video.ofs.bufferofs; gvar->video.ofs.bufferofs = gvar->video.ofs.displayofs; scan = gvar->mm.mmhead; diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index d664b28d..ce2733d3 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -26,8 +26,6 @@ #include "src/lib/16_tail.h" #include "src/lib/16text.h" -static word far* clockw= (word far*) 0x046C; /* 18.2hz clock */ - /* ========================== = @@ -247,68 +245,53 @@ void Shutdown16(global_game_variables_t *gvar) #define PIXPERFRAME 1600 -void FizzleFade (unsigned source, unsigned dest, - unsigned width,unsigned height, boolean abortable, global_game_variables_t *gv) +boolean FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) { - unsigned drawofs,pagedelta; - unsigned char maskb[8] = {1,2,4,8,16,32,64,128}; - unsigned x,y,p,frame; - long rndval; - word TimeCount = *clockw; + word p,pixperframe; + unsigned drawofs,pagedelta; + byte mask,maskb[8] = {1,2,4,8}; + unsigned x,y,frame ,esorig,q; + dword rndval; word screenseg = SCREENSEG; pagedelta = dest-source; -//++++ VL_SetScreen (dest,0); - rndval = 1; + rndval = 1; esorig = 0; q = 16; x = y = 0; + pixperframe = 76800/(dword)frames; + + IN_StartAck (gvar); __asm { - mov es,[screenseg] - mov dx,SC_INDEX - mov al,SC_MAPMASK - out dx,al + mov [esorig],es } - - TimeCount=frame=0; - do // while (1) + frame=0; + do // while (1) { - if (abortable) - { - IN_ReadControl(0,gv); - if (gv->player[0].info.button0 || gv->player[0].info.button1 || gv->in.inst->Keyboard[sc_Space] - || gv->in.inst->Keyboard[sc_Enter]) - { -//++++ VW_ScreenToScreen (source,dest,width/8,height); - return; - } + if (abortable && IN_CheckAck (gvar) ) + return true; + + __asm { + mov es,[screenseg] } - for (p=0;pwidth || y>height) + if ((x>width || y>height) && (xvideo.ofs.ylookup[y]; + drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); + + // + // copy one pixel + // +//* + mask = x&3; + VGAREADMAP(mask); + mask = maskb[mask]; + VGAMAPMASK(mask); +//*/ +// modexputPixel(&(gvar->video.page[0]), x, y, rand()%8); +// VL_Plot (x, y, 15, &(gvar->video.ofs)); __asm { - mov cx,[x] - mov si,cx - and si,7 - mov dx,GC_INDEX - mov al,GC_BITMASK - mov ah,BYTE PTR [maskb+si] - out dx,ax - - mov si,[drawofs] - shr cx,1 - shr cx,1 - shr cx,1 - add si,cx - mov di,si + mov di,[drawofs] + mov al,[es:di] add di,[pagedelta] - - mov dx,GC_INDEX - mov al,GC_READMAP // leave GC_INDEX set to READMAP - out dx,al - - mov dx,SC_INDEX+1 - mov al,1 - out dx,al - mov dx,GC_INDEX+1 - mov al,0 - out dx,al - - mov bl,[es:si] - xchg [es:di],bl - - mov dx,SC_INDEX+1 - mov al,2 - out dx,al - mov dx,GC_INDEX+1 - mov al,1 - out dx,al - - mov bl,[es:si] - xchg [es:di],bl - - mov dx,SC_INDEX+1 - mov al,4 - out dx,al - mov dx,GC_INDEX+1 - mov al,2 - out dx,al - - mov bl,[es:si] - xchg [es:di],bl - - mov dx,SC_INDEX+1 - mov al,8 - out dx,al - mov dx,GC_INDEX+1 - mov al,3 - out dx,al - - mov bl,[es:si] - xchg [es:di],bl + mov [es:di],al } if (rndval == 1) // entire sequence has been completed - { - VGABITMASK(255); - VGAMAPMASK(15); - return; - } + return false; } frame++; - while (TimeCountvideo.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this - /* virtual width and height. match screen, at first */ + // virtual width and height. match screen, at first // gv->video.page[0].height = gv->video.page[0].sh; gv->video.page[0].width = gv->video.page[0].sw; @@ -319,7 +320,15 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) case 2: // TODO: 160x120 according to ModeX_160x120regs return; case 3: // TODO: 160x120 according to ModeX_320x200regs - return; + gv->video.page[0].sw = vga_state.vga_width = 300; // VGA lib currently does not update this + gv->video.page[0].sh = vga_state.vga_height = 200; // VGA lib currently does not update this + // virtual width and height. match screen, at first // + gv->video.page[0].height = gv->video.page[0].sh; + gv->video.page[0].width = gv->video.page[0].sw; + + cm.offset = (vga_state.vga_width / (4 * 2)); // 320 wide (40 x 4 pixel groups x 2) + //return; + break; case 4: // TODO: 160x120 according to ModeX_192x144regs return; case 5: // TODO: 160x120 according to ModeX_256x192regs @@ -350,7 +359,8 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) } break; } - VL_SetLineWidth (cm.offset, &gv->video.ofs); + VL_SetLineWidth (cm.offset, gv); + gv->video.curr_mode=vq; gv->video.VL_Started=1; } @@ -360,6 +370,7 @@ void modexLeave(void) VL_vgaSetMode(TEXT_MODE); } +#if 0 page_t modexDefaultPage(page_t *p) { @@ -373,8 +384,46 @@ modexDefaultPage(page_t *p) page.dy = 0; page.sw = p->sw; page.sh = p->sh; - page.width = p->sw+TILEWHD; - page.height = p->sh+TILEWHD; + page.width = p->sw; + page.height = p->sh; + page.ti.tw = page.sw/TILEWH; + page.ti.th = page.sh/TILEWH; + page.ti.tilesw=page.width/TILEWH; + page.ti.tilesh=page.height/TILEWH; + page.ti.tilemidposscreenx = page.ti.tw/2; + page.ti.tilemidposscreeny = (page.ti.th/2)+1; + page.stridew=page.width/4; + page.pagesize = (word)(page.stridew)*page.height; + page.pi=page.width*4; + page.id = 0; + + if(ggvv->video.curr_mode = 1) + { + page.width += TILEWHD; + page.height += TILEWHD; + } + + return page; +} +#endif +page_t +modexDefaultPage(page_t *p, video_t *v) +{ + page_t page; + + /* default page values */ + //page.data = VGA; + //page.data = (byte far *)(vga_state.vga_graphics_ram); + page.data = (vga_state.vga_graphics_ram); + page.dx = 0; + page.dy = 0; + page.sw = p->sw; + page.sh = p->sh; + page.width = p->sw; + page.height = p->sh; + if(v->curr_mode == 1) +{ page.width += TILEWHD; + page.height += TILEWHD; } page.ti.tw = page.sw/TILEWH; page.ti.th = page.sh/TILEWH; page.ti.tilesw=page.width/TILEWH; @@ -477,7 +526,7 @@ void modexHiganbanaPageSetup(video_t *video) { video->vmem_remain=65535U; video->num_of_pages=0; - (video->page[0]) = modexDefaultPage(&(video->page[0])); video->num_of_pages++; //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); + (video->page[0]) = modexDefaultPage(&(video->page[0]), video); video->num_of_pages++; //video->page[0].width += (TILEWHD); video->page[0].height += (TILEWHD); (video->page[1]) = modexNextPage(&(video->page[0])); video->num_of_pages++; //0000 (video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), (video->page[0]).width, TILEWH*4); video->num_of_pages++; //0000 (video->page[3]) = (video->page[2]); video->num_of_pages++; @@ -878,7 +927,7 @@ modexLoadPalFile(byte *filename, byte *palette) { void VL_LoadPalFile(const char *filename, byte *palette, global_game_variables_t *gvar) { - VL_LoadPalFilewithoffset(filename, palette, 8, gvar); + VL_LoadPalFilewithoffset(filename, palette, 9, gvar); // VL_LoadPalFileCore(palette); } diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index a152cc35..519b1026 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -173,7 +173,7 @@ byte VL_vgaGetMode(void); extern void TL_VidInit(global_game_variables_t *gvar); void modexLeave(void); void modexsetBaseXMode(); -page_t modexDefaultPage(page_t *p); +page_t modexDefaultPage(page_t *p, video_t *v); page_t modexNextPage(page_t *p); page_t modexNextPageFlexibleSize(page_t *p, word x, word y); void modexCalcVmemRemain(video_t *video); @@ -258,7 +258,7 @@ void modexWaitBorder(); void modexWaitBorder_start(); void modexWaitBorder_end(); void VL_WaitVBL(word num); -void VL_SetLineWidth (unsigned width, ofs_t *ofs); +void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar); void VL_PrintmodexmemInfo(video_t *v); #endif diff --git a/src/lib/16_vl_1.c b/src/lib/16_vl_1.c index 7332d5fb..6956717e 100755 --- a/src/lib/16_vl_1.c +++ b/src/lib/16_vl_1.c @@ -169,7 +169,7 @@ SetScreen_done: ==================== */ -void VL_SetLineWidth (unsigned width, ofs_t *ofs) +void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar) { int i,offset; @@ -181,15 +181,17 @@ void VL_SetLineWidth (unsigned width, ofs_t *ofs) // // set up lookup tables // - ofs->linewidth = width*2; + gvar->video.ofs.linewidth = width*2; offset = 0; for (i=0;iylookup[i]=offset; - offset += ofs->linewidth; + gvar->video.ofs.ylookup[i]=offset; + offset += gvar->video.ofs.linewidth; } + gvar->video.ofs.displayofs = 0; + gvar->video.ofs.bufferofs = gvar->video.page[0].width*gvar->video.page[0].height;//gvar->video.page[0].pagesize; } /* diff --git a/src/lib/bakapee.c b/src/lib/bakapee.c index cf1dd904..0174d3c3 100755 --- a/src/lib/bakapee.c +++ b/src/lib/bakapee.c @@ -43,28 +43,42 @@ char global_temp_status_text2[512]; #define PIXPOSX gvar->video.page[0].sw/2 #define PIXPOSY gvar->video.page[0].sh/2 -boolean baka_FizzleFade (page_t *source, page_t *dest, unsigned frames, boolean abortable, global_game_variables_t *gvar) +/* +=================== += += FizzleFade += += returns true if aborted += +=================== +*/ + +//extern ControlInfo c; +#define PIXPOSX gvar->video.page[0].sw/2 +#define PIXPOSY gvar->video.page[0].sh/2 + +boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) { - dword p,pixperframe; + word p,pixperframe; unsigned drawofs,pagedelta; byte mask,maskb[8] = {1,2,4,8}; - unsigned x,y,frame ,esorig; + unsigned x,y,frame ,esorig,q; dword rndval; -// word TimeCount = *clockw; word screenseg = SCREENSEG; - pagedelta = (word)dest->sw*dest->sh;//(word)(source->data - dest->data);//(dest->data - source->data) - rndval = 1; esorig = 0; - x = y = dest->dx; - pixperframe = 76800/(dword)frames; + pagedelta = dest-source; + rndval = 1; esorig = 0; q = 16; + x = y = 0;//destpage->dx; + pixperframe = /*76800*/64000/(dword)frames; // IN_StartAck (); -// VL_ShowPage(dest, 1, 0); -// VL_ShowPage(source, 1, 0); +// VL_ShowPage(&(gvar->video.page[0]), 1, 0); +// VL_ShowPage(&(gvar->video.page[1]), 1, 0); -// modexClearRegion(dest, 0, 0, (dest->width), (dest->height), 12); - modexClearRegion(source, 0, 0, (source->width), (source->height), 64); +// modexClearRegion(&(gvar->video.page[0]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 0); +// modexClearRegion(&(gvar->video.page[1]), 0, 0, gvar->video.page[0].width, gvar->video.page[0].height, 15); +// VL_SetLineWidth(80, gvar); __asm { mov [esorig],es @@ -74,7 +88,7 @@ boolean baka_FizzleFade (page_t *source, page_t *dest, unsigned frames, boolean do // while (1) { sprintf(global_temp_status_text, "%u", frame); -modexprint(dest, PIXPOSX, PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); +modexprint(&(gvar->video.page[0]), PIXPOSX, PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); if (abortable && kbhit())//IN_CheckAck () ) return true; @@ -116,25 +130,31 @@ noxor: mov [WORD PTR rndval+2],dx } - if (x>dest->sw || y>dest->sh) +// if (x>destpage->width || y>destpage->height) +// if (xsw || ysh) + if ((x>width || y>height) && (xdata)+gvar->video.ofs.ylookup[y] + (x>>2); + drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); sprintf(global_temp_status_text, "draw - %Fp", drawofs); -modexprint(dest, PIXPOSX, 16+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); +modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; sprintf(global_temp_status_text, "pdet - %Fp", pagedelta); -modexprint(dest, PIXPOSX, 24+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); -sprintf(global_temp_status_text, "srce - %Fp", source->data); -modexprint(dest, PIXPOSX, 32+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); -sprintf(global_temp_status_text, "dest - %Fp", dest->data); -modexprint(dest, PIXPOSX, 40+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); +modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "srce - %Fp", source); +modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "dest - %Fp", dest); +modexprint(&(gvar->video.page[0]), PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q=16; // // copy one pixel // +//* mask = x&3; VGAREADMAP(mask); mask = maskb[mask]; VGAMAPMASK(mask); +//*/ +// modexputPixel(&(gvar->video.page[0]), x, y, rand()); +// VL_Plot (x, y, 15, &(gvar->video.ofs)); __asm { mov di,[drawofs] @@ -154,31 +174,43 @@ modexprint(dest, PIXPOSX, 40+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); } return false; } + #if 0 -boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width,unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) +boolean baka_FizzleFade (page_t *sourcepage, page_t *destpage, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar) { - int pixperframe; + word p,pixperframe; unsigned drawofs,pagedelta; byte mask,maskb[8] = {1,2,4,8}; - unsigned x,y,p,frame; + unsigned x,y,frame ,esorig,q; dword rndval; - word TimeCount = *clockw; + unsigned source,dest; +// word TimeCount = *clockw; word screenseg = SCREENSEG; + source = ((word)sourcepage->data); dest = ((word)destpage->data); - pagedelta = dest-source; - rndval = 1; - x = y = 0; - pixperframe = 64000/frames; + pagedelta = dest-source;//(word)(source->data - dest->data);//(dest->data - source->data) + rndval = 1; esorig = 0; q = 16; + x = y = destpage->dx; + pixperframe = /*76800*/64000/(dword)frames; - VGAmodeX(0, 0, gvar); // IN_StartAck (); -// VL_ShowPage((page_t *)dest, 1, 0); - VGAmodeX(1, 0, gvar); - TimeCount=frame=0; +// VL_ShowPage(destpage, 1, 0); +// VL_ShowPage(sourcepage, 1, 0); + +// modexClearRegion(destpage, 0, 0, (destpage->width), (destpage->height), 12); + modexClearRegion(sourcepage, 0, 0, (sourcepage->width), (sourcepage->height), 64); + + __asm { + mov [esorig],es + } +// TimeCount= + frame=0; do // while (1) { - if (abortable && !kbhit())//IN_CheckAck () ) +sprintf(global_temp_status_text, "%u", frame); +modexprint(destpage, PIXPOSX, PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); + if (abortable && kbhit())//IN_CheckAck () ) return true; __asm { @@ -191,31 +223,51 @@ boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width,unsigned // // seperate random value into x/y pair // - mov ax,[WORD PTR rndval] - mov dx,[WORD PTR rndval+2] - mov bx,ax - dec bl - mov [BYTE PTR y],bl // low 8 bits - 1 = y xoordinate - mov bx,ax - mov cx,dx - mov [BYTE PTR x],ah // next 9 bits = x xoordinate - mov [BYTE PTR x+1],dl + mov ax,[WORD PTR rndval] + mov dx,[WORD PTR rndval+2] + mov bx,ax + dec bl + mov [BYTE PTR y],bl // low 8 bits - 1 = y xoordinate + mov bx,ax + mov cx,dx + mov [BYTE PTR x],ah // next 9 bits = x xoordinate + mov [BYTE PTR x+1],dl // // advance to next random element // - shr dx,1 - rcr ax,1 - jnc noxor - xor dx,0x0001 - xor ax,0x2000 + shr dx,1 + rcr ax,1 + jnc noxor + xor dx,0x0001 + xor ax,0x2000 +#ifdef __BORLANDC__ + } +#endif noxor: - mov [WORD PTR rndval],ax - mov [WORD PTR rndval+2],dx +#ifdef __BORLANDC__ + __asm { +#endif + mov [WORD PTR rndval],ax + mov [WORD PTR rndval+2],dx } +// if (x>destpage->width || y>destpage->height) +// if (xsw || ysh) if (x>width || y>height) continue; - drawofs = source+gvar->video.ofs.ylookup[y] + (x>>2); + drawofs = source+(gvar->video.ofs.ylookup[y]) + (x>>2); +sprintf(global_temp_status_text, "draw - %Fp", drawofs); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "pdet - %Fp", pagedelta); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "srcp - %Fp", sourcepage->data); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "desp - %Fp", destpage->data); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "srce - %Fp", source); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q+=8; +sprintf(global_temp_status_text, "dest - %Fp", dest); +modexprint(destpage, PIXPOSX, q+PIXPOSY, 1, 0, 47, 0, 1, global_temp_status_text); q=16; // // copy one pixel @@ -236,8 +288,11 @@ noxor: return false; } frame++; -// while (TimeCountsw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi"); break; case 9: - //baka_FizzleFade (ggvv->video.ofs.bufferofs, ggvv->video.ofs.displayofs, page->sw, page->sh, false, ggvv); + baka_FizzleFade (ggvv->video.ofs.bufferofs, ggvv->video.ofs.displayofs, vga_state.vga_width, vga_state.vga_height, 70, true, ggvv); // modexprint(page, page->sw/2, page->sh/2, 1, 0, 47, 0, 1, "bakapi start"); // if(!baka_FizzleFade ((unsigned)page, (unsigned)page, page->width, page->height, 70, false, ggvv)) break; diff --git a/src/lib/bakapee.h b/src/lib/bakapee.h index 08af061b..d39a97e8 100755 --- a/src/lib/bakapee.h +++ b/src/lib/bakapee.h @@ -41,7 +41,7 @@ typedef struct { word bonk,lgq,hgq; } bakapee_t; -boolean baka_FizzleFade (page_t *source, page_t *dest, unsigned frames, boolean abortable, global_game_variables_t *gvar); +boolean baka_FizzleFade (unsigned source, unsigned dest, unsigned width, unsigned height, unsigned frames, boolean abortable, global_game_variables_t *gvar); void clrstdin(); void colortest(page_t *page, bakapee_t *pee); void colorz(page_t *page, bakapee_t *pee); diff --git a/src/palbomb.c b/src/palbomb.c index 80b9a9f5..61f55918 100755 --- a/src/palbomb.c +++ b/src/palbomb.c @@ -26,7 +26,7 @@ void main(int argc, char *argv[]) { TL_VidInit(&gvar); VGAmodeX(1, 0, &gvar); - gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]); + gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0], &gvar.video); VL_ShowPage(&gvar.video.page[0], 1, 0); modexpdump(&gvar.video.page[0]); while(!kbhit()){ VL_modexPalScramble(&gvar.video.palette); } diff --git a/src/palettec.c b/src/palettec.c index f221d837..9e6bc2b6 100755 --- a/src/palettec.c +++ b/src/palettec.c @@ -26,7 +26,7 @@ void main(int argc, char *argv[]) { TL_VidInit(&gvar); VGAmodeX(1, 0, &gvar); modexSavePalFile(bakapee, &gvar.video.palette); - gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);// modexFadeOn(4, &gvar.video.palette); + gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0], &gvar.video);// modexFadeOn(4, &gvar.video.palette); VL_ShowPage(&gvar.video.page[0], 1, 0); modexpdump(&gvar.video.page[0]); while(!kbhit()){ /*VL_modexPalScramble(&gvar.video.palette);*/ } diff --git a/src/palettel.c b/src/palettel.c index 3fdcf5a5..303dbf9d 100755 --- a/src/palettel.c +++ b/src/palettel.c @@ -27,7 +27,7 @@ void main(int argc, char *argv[]) TL_VidInit(&gvar); VGAmodeX(1, 0, &gvar); VL_LoadPalFile(bakapee, &gvar.video.palette, &gvar); //modexLoadPalFile(bakapee, &(gvar.video.palette)); - gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0]);// modexFadeOn(4, &gvar.video.palette); + gvar.video.page[0] = modexDefaultPage(&gvar.video.page[0], &gvar.video);// modexFadeOn(4, &gvar.video.palette); VL_ShowPage(&gvar.video.page[0], 1, 0); modexpdump(&gvar.video.page[0]); while(!kbhit()){ /*VL_modexPalScramble(&gvar.video.palette);*/ } -- 2.39.5