Been looking at lots of ascii demos recently during my period of dissilusionment. I have Been properly impressed with a lot of them, mind you the ones I liked the best seemed to not have dedicated ascii engines, these seem to take a small screen buffer and then later convert it into a visual display.
What I think is the appeal of these demo is that the refresh rates in the text modes has tears and glitches and gives them a nice look all of their own.
I want to make something like that with a cleaner look, I used ptc _ext by Rbraz so here is a basic routine that lets you change the resolution of the grid and the screen with no hassle.
For now it just draws random coloured blocks but the buffer could be made to display anything.
I plan you use it to draw some vector bobs and a plasma but it is here for you to use too if anybody feels like using it for anything.
Ok here is source code;
'
' PSEUDO ASCII CRACKTRO
' =====================
'
'
'
' WIDOW MAKER 2007
'
'
'-------------------------------------------------------------------------------
OPTION STATIC
OPTION EXPLICIT
' SCREEN RES
CONST XRES = 800
CONST YRES = 600
' GRID RES
CONST GRID = 8
DIM SHARED AS INTEGER WXRES
DIM SHARED AS INTEGER WYRES
WXRES = XRES / GRID
WYRES = YRES / GRID
' INCLUDES
#INCLUDE "TINYPTC_EXT.BI"
#INCLUDE "WINDOWS.BI"
'-------------------------------------------------------------------------------
' VARIABLES
DIM SHARED AS UINTEGER BUFFER ( XRES * YRES )
DIM SHARED AS UINTEGER WBUFFER ( WXRES * WYRES )
'-------------------------------------------------------------------------------
' SUBS
DECLARE SUB BLIT_BUFFER()
DECLARE SUB ERASE_GRID()
'-------------------------------------------------------------------------------
' OPEN SCREEN
PTC_ALLOWCLOSE(0)
PTC_SETDIALOG(0,"",0,0)
IF (PTC_OPEN("P0STM0RT3M",XRES,YRES)=0) THEN
END-1
END IF
'-------------------------------------------------------------------------------
' MAIN LOOP;
'-------------------------------------------------------------------------------
WHILE(GETASYNCKEYSTATE(VK_ESCAPE)<>-32767)
ERASE_GRID()
BLIT_BUFFER()
PTC_UPDATE@BUFFER(0)
WEND
END
'-------------------------------------------------------------------------------
' DRAWS THE SCREEN ACCORDING TO WHAT IS IN WBUFFER.
'-------------------------------------------------------------------------------
SUB BLIT_BUFFER()
DIM AS INTEGER XX,YY,Y2,SLICE,tc
DIM PP AS UINTEGER PTR
FOR YY=0 TO WYRES-1
FOR XX=0 TO WXRES-1
FOR Y2=0 TO GRID-1
pp=@buffer((XX*GRID)+(((YY*GRID)+Y2)*XRES))
SLICE = GRID
TC=WBUFFER(XX+(YY*WXRES))
asm
mov eax,dword ptr[TC]
mov ecx, [SLICE]
mov edi, [PP]
rep stosd
end asm
NEXT
NEXT
NEXT
END SUB
'-------------------------------------------------------------------------------
' FOR NOW JUST GENERATE RANDOM PIXELS, LATER IT WILL BE JUST DRAWN OVER.
'-------------------------------------------------------------------------------
SUB ERASE_GRID()
DIM AS INTEGER XX,YY
FOR YY=0 TO WYRES-1
FOR XX=0 TO WXRES-1
WBUFFER(XX+(YY*WXRES))=RGB(INT(RND(1)*255),INT(RND(1)*255),INT(RND(1)*255))
NEXT
NEXT
END SUB
Haven't bothered with an exe as it is just a screen full of flashing coloured squares
