diff --git a/src/dhgr.tk/makefile b/src/dhgr.tk/makefile index d5c4553..d29641d 100644 --- a/src/dhgr.tk/makefile +++ b/src/dhgr.tk/makefile @@ -8,7 +8,7 @@ DHGRSPRED = dhgr.tk/utils/DHGRSPRED.REL DHGREASY = dhgr.tk/utils/DHGREASY.REL DHGRRGB = dhgr.tk/utils/DHGRRGB.REL DHGRSHOW = dhgr.tk/utils/DHGRSHOW.REL -DLGRSHOW = dhgr.tk/utils/DLGRSHOW.REL +DLGRCONV = dhgr.tk/utils/DLGRCONV.REL PENGUINS = dhgr.tk/demos/penguins/PENGUINS.REL @@ -22,7 +22,7 @@ test: $(DHGRTEST) cp $(DHGRTEST) prodos/dhgr.tk/test cp dhgr.tk/test/*.BIN prodos/dhgr.tk/test -utils: $(DHGRSPRED) $(DHGREASY) $(DHGRRGB) $(DHGRSHOW) $(DLGRSHOW) +utils: $(DHGRSPRED) $(DHGREASY) $(DHGRRGB) $(DHGRSHOW) $(DLGRCONV) -mkdir prodos/dhgr.tk/ -mkdir prodos/dhgr.tk/utils -mkdir prodos/dhgr.tk/utils/samples @@ -67,9 +67,9 @@ $(DHGRSHOW): dhgr.tk/utils/dhgrshow.pla $(DHGRLIB) $(DHGRUTILS) dhgr.tk/inc/dhgr ./plasm -AMOW dhgr.tk/utils/dhgrshow.pla acme --setpc 4094 -o $(DHGRSHOW) dhgr.tk/utils/dhgrshow.a -$(DLGRSHOW): dhgr.tk/utils/dlgrshow.pla $(DHGRLIB) $(DHGRUTILS) dhgr.tk/inc/dhgrlib.plh dhgr.tk/inc/dhgrutils.plh - ./plasm -AMOW dhgr.tk/utils/dlgrshow.pla - acme --setpc 4094 -o $(DLGRSHOW) dhgr.tk/utils/dlgrshow.a +$(DLGRCONV): dhgr.tk/utils/dlgrconv.pla $(DHGRLIB) $(DHGRUTILS) dhgr.tk/inc/dhgrlib.plh dhgr.tk/inc/dhgrutils.plh + ./plasm -AMOW dhgr.tk/utils/dlgrconv.pla + acme --setpc 4094 -o $(DLGRCONV) dhgr.tk/utils/dlgrconv.a $(DHGRRGB): dhgr.tk/utils/dhgrrgb.pla $(DHGRLIB) $(DHGRUTILS) dhgr.tk/inc/dhgrlib.plh dhgr.tk/inc/dhgrutils.plh ./plasm -AMOW dhgr.tk/utils/dhgrrgb.pla diff --git a/src/dhgr.tk/utils/dhgrrgb.pla b/src/dhgr.tk/utils/dhgrrgb.pla index a7eba0d..39650e3 100644 --- a/src/dhgr.tk/utils/dhgrrgb.pla +++ b/src/dhgr.tk/utils/dhgrrgb.pla @@ -24,7 +24,7 @@ byte[] = 16, 12, 32 // BLUE byte[] = 0, 28, 16 // GREEN byte[] = 16, 20, 0 // BROWN byte[] = 32, 4, 16 // RED -// Calculated 0-255 R G B +//// Calculated 0-255 R G B //byte[] = 32, 46, 120 // BLUE //byte[] = 8, 126, 32 // GREEN //byte[] = 96, 82, 8 // BROWN diff --git a/src/dhgr.tk/utils/dlgrshow.pla b/src/dhgr.tk/utils/dlgrconv.pla similarity index 72% rename from src/dhgr.tk/utils/dlgrshow.pla rename to src/dhgr.tk/utils/dlgrconv.pla index a795e61..319670e 100644 --- a/src/dhgr.tk/utils/dlgrshow.pla +++ b/src/dhgr.tk/utils/dlgrconv.pla @@ -7,12 +7,13 @@ include "dhgr.tk/inc/dhgrutils.plh" sysflags restxt1|resxtxt1|reshgr1|resxhgr1 // Reserve all the pages -const FRAME_WIDTH = 80 -const FRAME_HEIGHT = 48 -const FRAME_SIZE = FRAME_WIDTH * FRAME_HEIGHT / 2 +const FRAME_WIDTH = 80 +const FRAME_HEIGHT = 48 +const FRAME_SIZE = FRAME_WIDTH * FRAME_HEIGHT / 2 const DLGRFRAME_SIZE = 2047 -const PAUSE = 1 -const HEIGHT_X2 = 2 +const PAUSE = 1 +const HEIGHT_X2 = 2 +const WRITE_DHGR = 4 var arg, srcfilelist, srcpath, srcexp, srccnt var entrylist, entrycnt @@ -67,57 +68,62 @@ def dlgrRead(filestr)#1 if frameptr and fileio:read(refnum, frameptr, DLGRFRAME_SIZE) <> DLGRFRAME_SIZE heaprelease(frameptr) frameptr = NULL + dhgrMode(DHGR_TEXT_MODE) + puts("Error reading: "); puts(filestr); putln fin fileio:close(refnum) fin return frameptr end -def dlgrImport(filename, framenum)#0 - var dlgrptr - byte screennum, i, j, numrows +def dhgrWrite(filename)#1 char[64] screenfile - screennum = framenum / 4 - numrows = 192 / FRAME_HEIGHT - if flags & HEIGHT_X2 - numrows = numrows / 2 - fin - numrows-- - j = framenum & ((flags & HEIGHT_X2) ?? 1 :: 3) - if not j - if framenum; getc; fin // Pause between frames - dcgrColor(CLR_GREY1) - dhgrClearBl7(0, 0, SCR_WIDTH7, SCR_HEIGHT) + strcpy(@screenfile, filename) + strcat(@screenfile, ".DHGR") + if screenWrite(@screenfile) + dhgrMode(DHGR_TEXT_MODE) + puts("Error writing: "); puts(@screenfile); putln + return FALSE fin + return TRUE +end + +def dlgrConvert(filename)#1 + var dlgrptr + byte i, j, numrows + + dcgrColor(CLR_GREY1) + dhgrClearBl7(0, 0, SCR_WIDTH7, SCR_HEIGHT) dlgrptr = dlgrRead(filename) if dlgrptr dlgr2dcgr(dlgrptr) heaprelease(dlgrptr) if flags & HEIGHT_X2 - dcgrPixMap(30, j*FRAME_HEIGHT*2, FRAME_WIDTH, FRAME_HEIGHT*2, @frame) + dcgrPixMap(30, 48, FRAME_WIDTH, FRAME_HEIGHT*2, @frame) else - dcgrPixMap(30, j*FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT, @frame) + dcgrPixMap(30, 72, FRAME_WIDTH, FRAME_HEIGHT, @frame) fin + if flags & WRITE_DHGR + return dhgrWrite(filename) + fin + return TRUE fin - strcpy(@screenfile, filename) - strcat(@screenfile, ".SCR") - screenfile++ - screenfile[screenfile] = '0' + screennum - screennum++ - //if screenWrite(@screenfile) - // dhgrMode(DHGR_TEXT_MODE) - // puts("Error writing: "); puts(@screenfile); putln - // return - //fin + return FALSE end arg = argNext(argFirst) while arg and ^(arg + 1) == '-' when toupper(^(arg + 2)) + is 'P' + flags = flags | PAUSE + break is '2' flags = flags | HEIGHT_X2 break + is 'W' + flags = flags | WRITE_DHGR + break wend arg = argNext(arg) loop @@ -147,14 +153,13 @@ while ^arg loop if srccnt dhgrMode(DHGR_COLOR_MODE) - for entrycnt = 0 to srccnt - 1 - dlgrImport(srcfilelist, entrycnt) + while srccnt and dlgrConvert(srcfilelist) + if flags & PAUSE; getc; fin srcfilelist = srcfilelist + t_fileentry - entrycnt++ - next - getc + srccnt-- + loop dhgrMode(DHGR_TEXT_MODE) return 0 fin -puts("Usage: DHGRGREASY [-P] [-2] [-T] FRAMEFILE\n") +puts("Usage: DHGRGREASY [-P] [-2] [W] FRAMEFILE\n") done