;PAINTDOG.MAR - Program to paint a walking DOG to a VT100 or VT52 ; terminal. ; A demonstration of using macros to easily paint a ; picture on the screen in normal and special graphics ; modes. ; The screen should be pictured as a grid 80 columns ; wide and 24 rows long. ; ; ; Written by: Clair Garman ; Educational Services ; Digital Equipment Corporation ; Washington, DC ; ; Revised by: Kathy Webb ; .TITLE PAINT_DUCK ; $DCDEF $LIBCLIDEF ; ;Macro to paint the specified character the specified number of times at ; the specified screen position ; .MACRO P CHAR,LINE,COL,NUM=1,?TOP MOVL #NUM,TEXT_DESC MOVL #NUM,R11 MOVL TEXT_DESC+4,R10 TOP: MOVB #^A|CHAR|,(R10)+ SOBGTR R11,TOP PUSHL #COL PUSHL #LINE PUSHAL TEXT_DESC CALLS #3,G^SCR$PUT_SCREEN .ENDM ; ;Macro to paint a number of blank spaces at the position specified ; .MACRO PS LINE,COL,NUM=1 MOVL #NUM,SPACE_DESC PUSHL #COL PUSHL #LINE PUSHAL SPACE_DESC CALLS #3,G^SCR$PUT_SCREEN .ENDM ; ;Macro to wait a period of time .MACRO WAIT,TIME,?LOOP MOVL #TIME,R11 LOOP: TSTL R11 SOBGTR R11,LOOP .ENDM ; .PSECT DATA PIC,NOEXE,LONG,NOSHR,WRT ; TEXT_DESC: .LONG .ADDRESS TEXT TEXT: .BLKB 80 SPACE_DESC: .LONG .ADDRESS SPACE SPACE: .REPT 80 .ASCII / / .ENDR QUACK: .LONG 9 .ADDRESS 10$ 10$: .BYTE 7,7 .ASCII /RUFF/ .BYTE 7,7 ; TREE: .LONG 9 .ADDRESS 20$ 20$: .BYTE 7,7 .ASCII /OH SHIT/ .BYTE 7,7 ; .PSECT CODE PIC,EXE,LONG,SHR,NOWRT ; PAINT_DUCK: .WORD ; ;Erase the screen ERASE: PUSHL #1 PUSHL #1 CALLS #2,G^SCR$ERASE_PAGE ;Paint the tail P ,1,9,1 P <->,1,10,2 P ,2,8,4 P <)>,2,12,1 P ,3,7,5 P <)>,3,12,1 P ,4,6,6 P ,5,5,4 P ,6,5,4 P <(>,7,4,1 P ,7,5,3 P <(>,8,4,1 P ,8,5,3 P <(>,9,4,1 P ,9,5,3 P <(>,10,4,1 P ,10,5,3 P ,11,4,5 P ,12,4,4 P ,13,5,2 ;Paint the back P <->,10,9,1 P ,10,10,9 P ,11,19,4 P ,12,23,1 ;Paint the head P ,11,24,1 P ,10,25,1 P ,9,26,1 P ,8,26,1 P ,7,27,1 P ,6,28,1 P <_>,5,29,3 P ,6,29,3 P ,7,28,4 P ,8,28,4 P ,9,28,4 P ,10,28,4 P ,11,28,4 P ,12,28,4 P <\>,13,28,1 P ,13,29,2 P ,13,31,1 P <)>,6,32,1 P <)>,7,32,1 P <(>,8,33,1 P ,9,33,1 P <\>,9,34,1 P <\>,10,35,2 P <)>,11,39,1 P <)>,12,39,1 ;* P <)>,13,38,1 P <->,11,34,4 P <)>,12,40,1 P ,14,32,1 P <(>,15,30,1 P ,15,31,1 P <(>,15,30,1 P <(>,16,29,1 ;Paint the legs P <(>,14,6,1 P <(>,15,6,1 P <(>,16,6,1 P ,17,6,1 P ,18,6,1 P ,19,5,1 P ,20,4,1 P ,21,3,1 P ,22,2,1 P <\>,23,3,1 P <\>,24,4,1 P ,24,5,1 P <\>,23,5,1 P <)>,22,5,1 P <)>,21,6,3 P ,20,9,1 P <\>,19,9,1 P <\>,20,10,1 P <\>,21,11,1 P <)>,22,12,1 P <(>,23,11,1 P <->,24,12,3 P <)>,24,15,1 P <)>,23,15,1 P <->,23,14,1 P ,22,14,1 P ,21,15,1 P <)>,20,15,1 P <)>,19,15,1 P <)>,18,14,1 P <\>,17,13,1 P <\>,16,12,1 P ,19,16,2 P ,20,18,4 P ,18,22,1 P ,19,22,1 P ,20,22,1 P ,21,21,1 P ,22,20,1 P <(>,23,19,1 P <\>,24,19,1 P <_>,24,20,1 P ,23,22,1 P ,22,23,1 P ,21,23,1 P ,20,24,1 P ,19,24,1 P ,18,25,1 P ,17,25,1 P <\>,21,25,1 P <\>,22,26,1 P <\>,23,27,1 P <_>,24,28,3 P ,24,31,1 P <\>,23,31,1 P ,23,30,1 P <\>,22,29,1 P <\>,21,28,1 P <\>,20,27,1 P <)>,19,27,1 P ,18,27,1 ;Paint the tree P ,1,59,12 P ,2,58,14 P ,3,57,16 P ,4,56,18 P ,5,56,18 P ,6,56,18 P ,7,55,20 P ,8,54,23 P ,9,53,24 P ,10,53,24 P ,11,53,24 P ,12,53,6 P ,12,59,1 P ,12,61,1 P ,12,62,7 P ,12,69,1 P ,12,70,7 P ,13,53,6 P ,13,59,1 P ,13,61,1 P ,13,62,6 P ,13,68,1 P ,13,70,7 P ,14,53,6 P <\>,14,59,1 P ,14,61,1 P ,14,62,5 P ,14,67,1 P ,14,69,1 P ,14,70,7 P ,15,53,7 P <\>,15,60,1 P <\>,15,62,1 P ,15,63,3 P ,15,66,1 P ,15,68,1 P ,15,69,8 P ,16,53,8 P <\>,16,61,1 P <\>,16,63,1 P ,16,64,1 P ,16,65,1 P ,16,67,1 P ,16,68,8 P ,17,53,8 P ,17,61,1 P <\>,17,64,1 P ,17,65,1 P ,17,67,1 P ,17,68,8 P ,18,54,6 P ,18,61,1 P ,18,67,1 P ,18,69,6 P ,19,61,1 P <~>,19,63,1 P <~>,19,66,1 P ,19,67,1 P ,20,61,1 P <.>,20,64,1 P ,20,67,1 P ,21,61,1 P ,21,67,1 P ,22,61,1 P ,22,67,1 P ,23,61,1 P ,23,67,1 P ,24,60,1 P <\>,24,68,1 ;Make the snout move PS 12,34,5 P <->,13,34,5 PUSHL #35 PUSHL #12 PUSHAL QUACK CALLS #3,G^SCR$PUT_SCREEN WAIT 200000 PS 12,35,5 PS 13,34,5 P <->,12,34,5 WAIT 100000 ;Do it again PS 12,34,5 P <->,13,34,5 PUSHL #35 PUSHL #12 PUSHAL QUACK CALLS #3,G^SCR$PUT_SCREEN WAIT 200000 PS 12,35,5 PS 13,34,5 P <->,12,34,5 WAIT 100000 ;Make the tree talk PS 21,61,7 P <->,22,61,7 PUSHL #62 PUSHL #21 PUSHAL TREE CALLS #3,G^SCR$PUT_SCREEN WAIT 200000 PS 21,62,7 PS 22,61,7 P <->,21,61,7 WAIT 100000 ;Do it again PS 21,61,7 P <->,22,61,7 PUSHL #62 PUSHL #21 PUSHAL TREE CALLS #3,G^SCR$PUT_SCREEN WAIT 200000 PS 21,62,7 PS 22,61,7 P <->,21,61,7 WAIT 100000 ;Place cursor at the bottom of the screen PUSHL #1 PUSHL #23 CALLS #2,G^SCR$SET_CURSOR ;Exit MOVL #SS$_NORMAL,R0 ;Status return RET ;Exit main routine .END PAINT_DUCK