HP Forums
(HP71B) Speed experience with Video (EMU71 and Video80 screen) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: (HP71B) Speed experience with Video (EMU71 and Video80 screen) (/thread-20695.html)

Pages: 1 2


(HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 10-24-2023 12:21 PM

I was making some words which execution is large on EMU71 (no complain; i expect it represent the reality).

DRAW-FRAME takes 1min37s in a standard speed EMU71 (with Video80 from C. GIESSELINK connected to it)

: XDIM 50 ;
: YDIM 20 ;
: AT-XY 27 EMIT 37 EMIT SWAP EMIT EMIT ;
: DRAW-FRAME 0 0 AT-XY XDIM 0 2DUP = IF 2DROP ELSE DO ." +" LOOP
THEN YDIM 0 2DUP = IF 2DROP ELSE DO XDIM I AT-XY ." +" CR ." +"
LOOP THEN XDIM 0 2DUP = IF 2DROP ELSE DO ." +" LOOP THEN CR ;

Has anybody a video interface and a screen to see if its a similar speed? or worse?
My impression is: HP71B is for outputting things on a screen; not for representing dynamic/changing pictures.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 10-24-2023 12:34 PM

(10-24-2023 09:13 AM)floppy Wrote:1. However, since I experienced 2x memory lost, I saved the FORTHRAM on virtual drive with ( basic prompt ) COPY FORTHRAM TO :HDRIVE1 and hopefully that will work
You could also add another RAM module, make it an IRAM (with FREE PORT) and then copy your FORTHRAM file into it.
An IRAM is not cleared when you get a "Memory Lost".

(10-24-2023 09:13 AM)floppy Wrote:2. the interaction with the video80 in EMU71 is very slow. I suppose this represent the reality when a 80 column screen is connected to an HP71B. Correct?
If you are using DISPLAY IS then DELAY 0,0 and a WIDTH of 80 would help.

(10-24-2023 09:13 AM)floppy Wrote:DRAW-FRAME takes 1min37s in a standard speed EMU71
Wrong strategy, use low level HP-IL commands to speed things up and use escape sequences to position the display cursor at the desired place on the external video display.

HP-71B BASIC commands are easy to use but not necessary fast, if you want to speed things up, you need to understand how things are working underneath and drive them directly.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 10-24-2023 01:56 PM

DELAY00 ( from FTHUTILF , equivalent to basic DELAY 0,0 ) reduced to 9s
80 WIDTH ! (additionally to above) reduced to 8s

looks better. Thanks. (<1s would be good)

I will see what to do more (HP-IL codes for Video already used): ASCII code instead of " +" or others.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 10-24-2023 02:59 PM

IMHO, the best strategy for a clock block-style graphic output to an external display would be to:
  • deactivate the display redirection (DISPLAY IS *)
  • create a string (S$) that would hold the startup configuration: screen size, cursor off, etc
  • create a string (L$) that would hold the leave configuration
  • create a string (F$) that would hold the frame
  • create a string (T$) that would hold the time
  • pre-generate the startup configuration string (mostly escape sequences) and save it to S$
  • pre-generate the leave configuration string (mostly escape sequences) and save it to L$
  • pre-generate the frame string (cursor position escape sequences and frame characters) and save it to F$
  • send S$ to external display
  • send F$ to external display
  • loop-begin
  • generate the time string (cursor position escape sequences and digit characters) and save it to T$
  • send T$ to external display
  • if exit key pressed then send L$ to external display and exit
  • loop-end



RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 10-27-2023 01:54 PM

Setup
  • Emu71 (controller)
  • Video80 [address 1]
Output time
  • Original speed: 0.65 seconds (1 frame, the bigger one)
  • Emulator speed: 0.03 second (1 frame, the bigger one)
  • Original speed: 2.01 seconds (4 frames)
  • Emulator speed: 0.25 second (4 frames)
HP-92198 Output:
Code:
  +--------------------------------------------------------------------------+  
  |                                                                          |  
  |   +------------------------------------------------------------------+   |  
  |   |                                                                  |   |  
  |   |   +----------------------------------------------------------+   |   |  
  |   |   |                                                          |   |   |  
  |   |   |   +--------------------------------------------------+   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   |                                                  |   |   |   |  
  |   |   |   +--------------------------------------------------+   |   |   |  
  |   |   |                                                          |   |   |  
  |   |   +----------------------------------------------------------+   |   |  
  |   |                                                                  |   |  
  |   +------------------------------------------------------------------+   |  
  |                                                                          |  
  +--------------------------------------------------------------------------+

BASIC program:
Code:
10 ! SHOW FRAMES
20 OPTION BASE 0 @ DELAY 0,0
30 DIM B0$[20],B1$[400], B2$[400], B3$[400], B4$[400]
40 DISP "BUFFERING"
50 CALL DRESET(B0$)
60 CALL DFRAME(B1$,1,2,22,77)
70 CALL DFRAME(B2$,3,6,20,73)
80 CALL DFRAME(B3$,5,10,18,69)
90 CALL DFRAME(B4$,7,14,16,65)
100 DISP "OUTPUT"
110 T=TIME @ A=1
120 CALL DSEND(B0$,A)
130 CALL DSEND(B1$,A)
140 CALL DSEND(B2$,A)
150 CALL DSEND(B3$,A)
160 CALL DSEND(B4$,A)
170 T=TIME-T @ DISP T
180 END

200 SUB DRESET(B$) ! dsp.reset (transmit.buffer)
210 E$=CHR$(27) ! escape
220 B$=E$&"E"&E$&"<" ! clear screen & cursor off
230 END SUB

300 SUB DFRAME(B$,R1,C1,R2,C2) ! dsp.frame(t.buffer, r.top, c.left, r.bottom, c.right)
310 E$=CHR$(27) @ V$=CHR$(124) @ H$="-" @ C$="+"
320 B$=E$&"%"&CHR$(C1)&CHR$(R1) ! set cursor to (c.left, r.top)
330 B$=B$&C$ @ FOR I=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT I @ B$=B$&C$
340 FOR I=R1+1 TO R2-1
350 B$=B$&E$&"%"&CHR$(C1)&CHR$(I)&V$&E$&"%"&CHR$(C2)&CHR$(I)&V$
360 NEXT I
370 B$=E$&"%"&CHR$(C1)&CHR$(R2) ! set cursor to (c.left, r.bottom)
380 B$=E$&B$&C$ @ FOR I=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT I @ B$=B$&C$
390 END SUB

400 SUB DSEND(B$,A) ! send to (transmit.buffer, device.address)
410 SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL
420 END SUB

Note: buffers size are not optimized

edit: changed DSEND parameters order to have parameters uniformity between subs


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 10-29-2023 07:37 PM

This is a clock program that I just wrote.

It update the date and time on the external screen when there is a change only.
The limitation here is the HP-71B processor speed.
When I am using Emu71 at the fastest cpu speed the external display is updated at each second,
but I am using Emu71 at the original cpu speed the external display is updated between 2 to 5 seconds.

Click on "View a Printable Version" at the bottom of the page to get a version without scrollbar.

External screen example:
Code:
+------------------------------------------------------------------------------+
|                                                                              |
|   #######   #######       #     ##      #####        #  #######   #######    |
|  ##     ## ##     ##     #    ####     ##   ##      #  ##     ## ##     ##   |
|         ##        ##    #       ##    ##     ##    #          ## ##     ##   |
|   #######   #######    ##       ##    ##     ##   ##    #######   ########   |
|  ##               ##   #        ##    ##     ##   #    ##               ##   |
|  ##        ##     ##  #         ##     ##   ##   #     ##        ##     ##   |
|  #########  #######  #       #######    #####   #      #########  #######    |
|                                                                              |
+------------------------------------------------------------------------------+
|                                                                              |
|      ##    #########   ##    #######   #######    ##   ##         #######    |
|    ####    ##         ####  ##     ## ##     ##  ####  ##    ##  ##     ##   |
|      ##    ##          ##          ##        ##   ##   ##    ##  ##     ##   |
|      ##    ########          #######   #######         ##    ##   #######    |
|      ##           ##   ##          ## ##          ##   ######### ##     ##   |
|      ##    ##     ##  ####  ##     ## ##         ####        ##  ##     ##   |
|   #######   #######    ##    #######  #########   ##         ##   #######    |
|                                                                              |
+------------------------------------------------------------------------------+

Clock on external display video: FASTEST SPEED vs ORIGINAL SPEED

I have created the following font for the external display:
Code:
    123456789   123456789   123456789   123456789   123456789   123456789   123456789   123456789   123456789   123456789
  +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
1 |   #####   |     ##    |  #######  |  #######  | ##        | ######### |  #######  | ######### |  #######  |  #######  |
2 |  ##   ##  |   ####    | ##     ## | ##     ## | ##    ##  | ##        | ##     ## | ##    ##  | ##     ## | ##     ## |
3 | ##     ## |     ##    |        ## |        ## | ##    ##  | ##        | ##        |      ##   | ##     ## | ##     ## |
4 | ##     ## |     ##    |  #######  |  #######  | ##    ##  | ########  | ########  |     ##    |  #######  |  ######## |
5 | ##     ## |     ##    | ##        |        ## | ######### |        ## | ##     ## |    ##     | ##     ## |        ## |
6 |  ##   ##  |     ##    | ##        | ##     ## |       ##  | ##     ## | ##     ## |    ##     | ##     ## | ##     ## |
7 |   #####   |  #######  | ######### |  #######  |       ##  |  #######  |  #######  |    ##     |  #######  |  #######  |
  +-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
Code:
    123456   123456
  +--------+--------+
1 |   ##   |      # |
2 |  ####  |     #  |
3 |   ##   |    #   |
4 |        |   ##   |
5 |   ##   |   #    |
6 |  ####  |  #     |
7 |   ##   | #      |
  +--------+--------+

The BASIC clock program:
Code:
 5 ! show time
10 OPTION BASE 0 @ DELAY 0,0
15 DIM B0$[20],B1$[500],B2$[1000]
20 DIM D$(10)[7*9],P$(2)[7*6]
25 A=1
30 CALL BFONT(D$,P$)
35 B0$="" @ CALL BSETUP(B0$) @ CALL ILSEND(B0$,A)
40 B1$="" @ CALL BFRAME(B1$,1,0,21,79) @ CALL ILSEND(B1$,A)
45 B1$="" @ CALL BFRAME(B1$,11,0,11,79) @ CALL ILSEND(B1$,A)
50 D0$="" @ T$=""
55 B2$="" @ D1$=D0$ @ CALL BDATE(B2$,D$(),P$(), 3,3,D0$) @ IF D1$#D0$ THEN CALL ILSEND(B2$,A)
60 B2$="" @ CALL BTIME(B2$,D$(),P$(),13,3,T$) @ CALL ILSEND(B2$,A)
65 DISP "20"&D0$&" "&T$
70 IF LEN(KEY$)=0 THEN GOTO 55
75 B0$="" @ CALL BRESET(B0$) @ CALL ILSEND(B0$,A)
80 PUT "#43"
85 END

300 SUB BDATE(B$,D$(),P$(),R,C,D1$) ! build-date
305   D2$=DATE$ @ L=LEN(D1$) @ IF L=0 THEN D1$="99/99/99"
306   IF D2$=D1$ THEN GOTO 355
310   D=VAL(D2$[1,1]) @ IF L=0 OR (VAL(D1$[1,1]) # D) THEN CALL BDIGIT(B$,R,C,D$(),D)
315   D=VAL(D2$[2,2]) @ IF L=0 OR (VAL(D1$[2,2]) # D) THEN CALL BDIGIT(B$,R,C+10,D$(),D)
320   IF L=0 THEN CALL BPUNCT(B$,R,C+20,P$(),1)
325   D=VAL(D2$[4,4]) @ IF L=0 OR (VAL(D1$[4,4]) # D) THEN CALL BDIGIT(B$,R,C+27,D$(),D)
330   D=VAL(D2$[5,5]) @ IF L=0 OR (VAL(D1$[5,5]) # D) THEN CALL BDIGIT(B$,R,C+37,D$(),D)
335   IF L=0 THEN CALL BPUNCT(B$,R,C+47,P$(),1)
340   D=VAL(D2$[7,7]) @ IF L=0 OR (VAL(D1$[7,7]) # D) THEN CALL BDIGIT(B$,R,C+54,D$(),D)
345   D=VAL(D2$[8,8]) @ IF L=0 OR (VAL(D1$[8,8]) # D) THEN CALL BDIGIT(B$,R,C+64,D$(),D)
350   D1$=D2$
355 END SUB

400 SUB BTIME(B$,D$(),P$(),R,C,T$) ! build-time
405   T1$=TIME$ @ L=LEN(T$) @ IF L=0 THEN T$="99:99:99"
410   D=VAL(T1$[1,1]) @ IF L=0 OR (VAL(T$[1,1]) # D) THEN CALL BDIGIT(B$,R,C,D$(),D)
415   D=VAL(T1$[2,2]) @ IF L=0 OR (VAL(T$[2,2]) # D) THEN CALL BDIGIT(B$,R,C+10,D$(),D)
420   IF L=0 THEN CALL BPUNCT(B$,R,C+20,P$(),0)
425   D=VAL(T1$[4,4]) @ IF L=0 OR (VAL(T$[4,4]) # D) THEN CALL BDIGIT(B$,R,C+27,D$(),D)
430   D=VAL(T1$[5,5]) @ IF L=0 OR (VAL(T$[5,5]) # D) THEN CALL BDIGIT(B$,R,C+37,D$(),D)
435   IF L=0 THEN CALL BPUNCT(B$,R,C+47,P$(),0)
440   D=VAL(T1$[7,7]) @ IF L=0 OR (VAL(T$[7,7]) # D) THEN CALL BDIGIT(B$,R,C+54,D$(),D)
445   D=VAL(T1$[8,8]) @ IF L=0 OR (VAL(T$[8,8]) # D) THEN CALL BDIGIT(B$,R,C+64,D$(),D)
450   T$=T1$
455 END SUB

550 SUB BSETUP(B$) ! build-setup
555   B$=B$&CHR$(27)&"E"&CHR$(27)&"<"
560 END SUB

575 SUB BRESET(B$) ! build-reset
580   B$=B$&CHR$(27)&"E"
585 END SUB

600 SUB BFRAME(B$,R1,C1,R2,C2) ! build-frame
605   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
610   V$=CHR$(124) @ H$="-" @ C$="+"
615   B$=B$&FNC$(R1,C1)
620   B$=B$&C$ @ FOR C=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT C @ B$=B$&C$
625   FOR R=R1+1 TO R2-1
630     B$=B$&FNC$(R,C1)&V$&FNC$(R,C2)&V$
635   NEXT R
640   B$=B$&FNC$(R2,C1)
645   B$=B$&C$ @ FOR C=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT C @ B$=B$&C$
650 END SUB

700 SUB BDIGIT(B$,R,C,D$(),D) ! build-digit
705   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
710   DEF FND$(N$,L)=N$[L*9+1,L*9+9]
715   FOR I=0 TO 6
720     B$=B$&FNC$(R+I,C)&FND$(D$(D),I)
725   NEXT I
730 END SUB

750 SUB BPUNCT(B$,R,C,P$(),P) ! build-punct
755   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
760   DEF FNP$(P$,L)=P$[L*6+1,L*6+6]
765   FOR I=0 TO 6
770     B$=B$&FNC$(R+I,C)&FNP$(P$(P),I)
775   NEXT I
780 END SUB

800 SUB BFONT(D$(),P$()) ! build-font
810   D$(0)="  #####   ##   ## ##     ####     ####     ## ##   ##   #####  " ! 0
811   D$(1)="    ##     ####       ##       ##       ##       ##    ####### " ! 1
812   D$(2)=" ####### ##     ##       ## ####### ##       ##       #########" ! 2
813   D$(3)=" ####### ##     ##       ## #######        ####     ## ####### " ! 3
814   D$(4)="##       ##    ## ##    ## ##    ## #########      ##       ## " ! 4
815   D$(5)="###########       ##       ########        ####     ## ####### " ! 5
816   D$(6)=" ####### ##     ####       ######## ##     ####     ## ####### " ! 6
817   D$(7)="###########    ##      ##      ##      ##       ##       ##    " ! 7
818   D$(8)=" ####### ##     ####     ## ####### ##     ####     ## ####### " ! 8
819   D$(9)=" ####### ##     ####     ## ########       ####     ## ####### " ! 9
820   P$(0)="  ##   ####   ##          ##   ####   ##  " ! :
821   P$(1)="     #    #    #    ##    #    #    #     " ! /
830 END SUB

900 SUB ILSEND(B$,A) ! hp-il send
910   SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL
920 END SUB

edit #1: videos moved to YouTube and links updated.
edit #2: there is another small optimization possible , I will update the program later (updated)
edit #3: the above program was a good starting point, but I now see more optimization that could give a better refresh rate at normal speed, maybe later, if I have time.

Sylvain


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 10-30-2023 12:48 PM

Nice. Now, never a reason for not starting EMU71 at PC boot.
We can see approx a 3-4s refresh under normal conditions which is imho enough (for a clock).


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 10-31-2023 06:02 PM

Another graphic program: SNAKE in forth (last update 13 Dec 2023; tested on EMU71; speed improvement)

2023 12 28 bug: will be corrected the next weeks.. in case the new apple location appear on the body area of the snake, it will disappear from the screen. Rarely happening. However > 0.26%

Upload:
FTHUTILA and C
TIME (ASM)
H71B1
SNAKE

keys:
w or W up
a or A left
s or S down
d or D right

start in the forth prompt with..
D-D ( redirect to the screen )
SSNAKE

H71B1
Code:
( under CC BY SA CreativeCommons floppy @ )
( https://www.hpmuseum.org/forum/ )
VARIABLE CELLV
HERE 0 , HERE SWAP - CELLV !
2 STRING RES2CHR
RES2CHR 27 CHR$ S<& 69 CHR$ S<& 2DROP
-1 CONSTANT TRUE
0 CONSTANT FALSE
: >= < 0= ;
: 0<> 0= 0= ;
: .R >R S->D R> D.R ;
: D0= OR 0= ;
: D= D- D0= ;
: 2, , , ;
: 2! SWAP OVER ! 5+ ! ;
: 2@ DUP 5+ @ SWAP @ ; 
: 2CONSTANT CREATE , , DOES> 2@ ;
: 2VARIABLE CREATE 0 , 0 , DOES> ;
: 2NIP 2SWAP 2DROP ;
: AT-XY 27 EMIT 37 EMIT SWAP EMIT EMIT ;
: AT-XY<BF 2SWAP 27 CHR$ S<& 37 CHR$ S<& 4 ROLL CHR$ S<& ROT
CHR$ S<& ;
: BLANK 20 FILL ;
: CELLS 5 * ;
: CELL+ 5+ ;
: CELL- 5- ;
: CHAR+ 2+ ;
: CHAR- 2- ;
: CHAR BL WORD CHAR+ C@ ;
: NIP SWAP DROP ;
: N>$ S->D STR$ ;
: ON TRUE SWAP ! ;
: OFF FALSE SWAP ! ;
: PAGE 27 EMIT 69 EMIT ;
: WITHIN OVER - >R - R> U< ;
: VALUE CREATE , DOES> @ ;
: CHARS 2* ;
: COMPARE S= 0<> ;
: CLEARSTR DROP DUP 1 CHARS - 0 SWAP C! 0 ;
: MS 0 DO LOOP ;
: PERFORM @ EXECUTE ;
: -ROT ROT ROT ;
: PMOD DUP -ROT MOD DUP 0< IF + ELSE NIP THEN ;
: STRDUMP OVER 0 DO DUP I SWAP MOD 0= IF CR ELSE THEN -ROT C@+ .
ROT " " TYPE LOOP 2DROP DROP ;

SNAKE
Code:
( original from https://github.com/robertpfeiffer/forthsnake/.. )
( ..blob/master/snake.forth )
( updates under CC BY SA CreativeCommons floppy @ )
( https://www.hpmuseum.org/forum/ )
76 STRING LINEBUF
128 STRING SIDEBUF
52 STRING SL1
" +--------------------------------------------------+" SL1 S!
: STRV CREATE DUP 1 - 5 * 1 + DUP C, C, 43 C, 2 - 0 DO 27 C, 66
C, 27 C, 68 C, 124 C, LOOP 27 C, 66 C, 27 C, 68 C, 43 C, DOES>
1 CHARS + DUP 1 CHARS + SWAP C@ ;
15 STRING SNAKEBUF
21 STRING LENGTHBUF
5 STRING APPLEBUF
: MYRAND OVER - TIME 1000.0 F/ FP 100000.0 F* FTOI SWAP PMOD + ;
: SNAKE-SIZE 200 ;
: XDIM 51 ;
: YDIM 21 ;
YDIM 1 + STRV SV1
CREATE SNAKE SNAKE-SIZE CELLS 2 * NALLOT
CREATE APPLE 2 CELLS NALLOT
CREATE APPLE_OLD 2 CELLS NALLOT
VARIABLE HEAD
VARIABLE LENGTH
VARIABLE DIRECTION
: SEGMENT HEAD @ + SNAKE-SIZE PMOD CELLS 2 * SNAKE + ;
: POS+ ROT + -ROT + SWAP ;
: POINT= 2@ ROT 2@ ROT = -ROT = AND ;
: HEAD* 0 SEGMENT ;
: MOVE-HEAD! HEAD @ 1 - SNAKE-SIZE PMOD HEAD ! ;
: GROW! 1 LENGTH +! ;
: EAT-APPLE! APPLE 2@ APPLE_OLD 2! 1 XDIM MYRAND 1 YDIM MYRAND
APPLE 2! GROW! ;
: STEP! HEAD* 2@ MOVE-HEAD! POS+ HEAD* 2! ;
: LEFT -1 0 ; 
: RIGHT 1 0 ;
: DOWN 0 1 ;
: UP 0 -1 ;
: WALL? HEAD* 2@ 1 YDIM WITHIN SWAP 1 XDIM WITHIN AND NOT ;
: CROSSING? FALSE LENGTH @ 1 2DUP = IF 2DROP ELSE DO I SEGMENT
HEAD* POINT= OR LOOP THEN ;
: APPLE? HEAD* APPLE POINT= ;
: DEAD? WALL? CROSSING? OR ;
: DRAW-FRAME LINEBUF CLEARSTR 0 0 AT-XY<BF SL1 S<& OUTPUT
LINEBUF CLEARSTR 0 YDIM AT-XY<BF SL1 S<& OUTPUT SIDEBUF CLEARSTR
0 0 AT-XY<BF SV1 S<& OUTPUT SIDEBUF CLEARSTR XDIM 0 AT-XY<BF SV1
S<& OUTPUT ;
: DRAW-SNAKE SNAKEBUF CLEARSTR LENGTH @ 0 2DUP = IF 2DROP ELSE
DO I SEGMENT 2@ AT-XY<BF 35 CHR$ S<& LOOP THEN OUTPUT ;
: UPDATE-SNAKE SNAKEBUF CLEARSTR 0 SEGMENT 2@ AT-XY<BF " #" S<&
OUTPUT SNAKEBUF CLEARSTR LENGTH @ SEGMENT 2@ AT-XY<BF 32 CHR$
S<& OUTPUT ;
: DRAW-APPLE APPLEBUF CLEARSTR APPLE 2@ AT-XY<BF " Q" S<& OUTPUT
;
: UPDATE-APPLE APPLEBUF CLEARSTR APPLE_OLD 2@ AT-XY<BF " #"
S<& OUTPUT DRAW-APPLE ;
: DRAW-LENGTH LENGTHBUF CLEARSTR 0 22 AT-XY<BF " SNAKE LENGTH: "
S<& LENGTH @ N>$ S<& OUTPUT ;
: UPDATE-LENGTH LENGTHBUF CLEARSTR 14 22 AT-XY<BF LENGTH @ N>$
S<& OUTPUT ;
: NEWGAME! RES2CHR OUTPUT 0 HEAD ! XDIM 2 / YDIM 2 / SNAKE 2! 3
3 APPLE 2! 3 LENGTH ! ['] UP DIRECTION ! LEFT STEP! LEFT STEP!
LEFT STEP! LEFT STEP! DRAW-FRAME DRAW-SNAKE DRAW-APPLE
DRAW-LENGTH ;
: GAMELOOP BEGIN DUP MS ?TERMINAL IF KEY DUP 97 = IF ['] LEFT
ELSE DUP 65 = IF ['] LEFT ELSE DUP 119 = IF ['] UP ELSE DUP 87 =
IF ['] UP ELSE DUP 100 = IF ['] RIGHT ELSE DUP 68 = IF ['] RIGHT
ELSE DUP 115 = IF ['] DOWN ELSE DUP 83 = IF ['] DOWN ELSE 
DIRECTION @ THEN THEN THEN THEN THEN THEN THEN THEN DIRECTION !
DROP THEN DIRECTION PERFORM STEP! APPLE? IF EAT-APPLE!
UPDATE-APPLE UPDATE-LENGTH ELSE UPDATE-SNAKE THEN DEAD? UNTIL
DROP ." *** GAME OVER ***" CR ;
: SSNAKE DELAY00  0 PRIMARY !  RES2CHR OUTPUT CR CR 
." Snake in Forth" CR CR 3000 MS NEWGAME! 200 GAMELOOP ;



RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 11-03-2023 06:45 PM

I have optimized my clock program, the refresh rate is now at 2 seconds when running at original speed and under 1 second when running at full speed.

My test setup was:
  • macOS Ventura (v13.6.1)
  • Parallels Desktop (v19.1.0)
  • Windows 7 Pro 32-bit (v6.1 b7601 SP1)
  • Emu71 (v1.17)
  • ILVideo80 (v1.3)
  • ILPer (v2.4)
  • lifutils (v1.7.10)
HP-IL loop setup
  • Address 0 : Emu71 (controller)
  • Address 1 : ILVideo80 (DISPLAY)
  • Address 2 : ILPer - Printer (DISPLAY)
  • Address 3 : ILPer - Drive1 (HP9114B)
  • Address 4 : ILPer - Drive2 (HDRIVE1)
  • Address 5 : ILPer - DosLink (DOSLINK)
TCP/IP configuration

Code:
Device      IP-address   TCP-in-port   TCP-out-port
Emu71       localhost       60000         60001
ILVideo80   localhost       60001         60002
ILPer       localhost       60002         60000

Files: Video v2 BASIC listing:
Code:
  5 ! digital clock v2
 10 OPTION BASE 0 @ DELAY 0,0 @ A=1

 20 DISP "MEM ALLOC"
 22 DIM B0$[2*10] ! BSETUP
 24 DIM B9$[2*10] ! BRESET
 26 DIM B1$[((4+80)*2)+((4+1)*22*2)] ! frame
 28 DIM B2$[(4+80)*2] ! middle line
 30 DIM B3$[((9+4)*7*6)+((6+4)*7*2)] ! date
 32 DIM B4$[((9+4)*7*6)+((6+4)*7*2)] ! time
 34 DIM F1$(10)[9*7],   F2$(2)[6*7]      ! font arrays
 36 DIM T1$(3)[(9+4)*7],T2$(10)[(9+4)*7] ! {0..2} & {0..9} hours caching
 38 DIM T3$(6)[(9+4)*7],T4$(10)[(9+4)*7] ! {0..5} & {0..9} minutes caching
 40 DIM T5$(6)[(9+4)*7],T6$(10)[(9+4)*7] ! {0..5} & {0..9} seconds caching
 42 DIM P$(4)[(6+4)*7] ! {: : / /} punctuations caching
 44 DIM R(2), C(8) ! row & col positions

 50 DISP "BUILDING CACHE"
 52 B0$="" @ CALL BSETUP(B0$)
 54 B9$="" @ CALL BRESET(B9$)
 56 R(0)= 3 @ R(1)=13 @ W1=10 @ W2=7
 58 C(0)= 3 @ C(1)=13 @ C(2)=23 @ C(3)=30
 60 C(4)=40 @ C(5)=50 @ C(6)=57 @ C(7)=67
 62 CALL LDIGIT(F1$) @ CALL LPUNCT(F2$)
 64 FOR I=0 TO 2 @ T1$(I)="" @ CALL BDIGIT(T1$(I),R(1),C(0),F1$(),I) @ NEXT I
 66 FOR I=0 TO 9 @ T2$(I)="" @ CALL BDIGIT(T2$(I),R(1),C(1),F1$(),I) @ NEXT I
 68 P$(2)="" @ CALL BPUNCT(P$(2),R(1),C(2),F2$(),0)
 70 FOR I=0 TO 5 @ T3$(I)="" @ CALL BDIGIT(T3$(I),R(1),C(3),F1$(),I) @ NEXT I
 72 FOR I=0 TO 9 @ T4$(I)="" @ CALL BDIGIT(T4$(I),R(1),C(4),F1$(),I) @ NEXT I
 74 P$(3)="" @ CALL BPUNCT(P$(3),R(1),C(5),F2$(),0)
 76 FOR I=0 TO 5 @ T5$(I)="" @ CALL BDIGIT(T5$(I),R(1),C(6),F1$(),I) @ NEXT I
 78 FOR I=0 TO 9 @ T6$(I)="" @ CALL BDIGIT(T6$(I),R(1),C(7),F1$(),I) @ NEXT I
 80 B1$="" @ CALL BFRAME(B1$, 1,0,21,79)
 82 B2$="" @ CALL BFRAME(B2$,11,0,11,79)

100 DISP "SHOW CLOCK"
102 CALL ILSEND(B0$,A) @ CALL ILSEND(B1$,A) @ CALL ILSEND(B2$,A)
104 D8$="" @ D9$="" @ T8$="" @ T9$=""
106 D0$=D9$ @ B3$=""
108 CALL BDATE(B3$,F1$(),F2$(),  3,3,W1,W2,D8$,D9$)
110 IF D0$#D8$ THEN CALL ILSEND(B3$,A)
112 T0$=T9$ @ B4$=""
114 ! CALL BTIME(B4$,F1$(),F2$(), 13,3,W1,W2,T8$,T9$)
116 CALL CTIME(B4$,T1$(),T2$(),T3$(),T4$(),T5$(),T6$(),P$(2),P$(3),T8$,T9$)
118 IF T0$#T9$ THEN CALL ILSEND(B4$,A)
120 DISP "20"&D9$&" "&T9$
122 IF LEN(KEY$)=0 THEN GOTO 106

190 DISP "END"
192 CALL ILSEND(B9$,A)
194 PUT "#43"
196 END

450 ! cached-time(buffer,digit-cached-array(6x),punct-cached(2x),current-time,prev-time)
452 SUB CTIME(B$,C1$(),C2$(),C3$(),C4$(),C5$(),C6$(),P1$,P2$,T1$,T2$)
454   L1=LEN(T1$) @ T1$=TIME$
456   L2=LEN(T2$) @ IF L2=0 THEN T2$=T1$
458   IF L1>0 AND T1$=T2$ THEN GOTO 490
460   T1=VAL(T1$[1,1]) @ T2=VAL(T2$[1,1])
462   IF L1=0 OR T1#T2 THEN B$=B$&C1$(T1)
464   T1=VAL(T1$[2,2]) @ T2=VAL(T2$[2,2])
466   IF L1=0 OR T1#T2 THEN B$=B$&C2$(T1)
468   IF L1=0 THEN B$=B$&P1$
470   T1=VAL(T1$[4,4]) @ T2=VAL(T2$[4,4])
472   IF L1=0 OR T1#T2 THEN B$=B$&C3$(T1)
474   T1=VAL(T1$[5,5]) @ T2=VAL(T2$[5,5])
476   IF L1=0 OR T1#T2 THEN B$=B$&C4$(T1)
478   IF L1=0 THEN B$=B$&P2$
480   T1=VAL(T1$[7,7]) @ T2=VAL(T2$[7,7])
482   IF L1=0 OR T1#T2 THEN B$=B$&C5$(T1)
484   T1=VAL(T1$[8,8]) @ T2=VAL(T2$[8,8])
486   IF L1=0 OR T1#T2 THEN B$=B$&C6$(T1)
488   T2$=T1$
490 END SUB

500 ! build-date(buffer,digit-font,punct-font,row,col,d-width,p-width,curr-date,prev-date)
502 SUB BDATE(B$,D$(),P$(),R,C,W1,W2,D1$,D2$)
504   L1=LEN(D1$) @ D1$=DATE$
506   L2=LEN(D2$) @ IF L2=0 THEN D2$=D1$
508   IF L1>0 AND D1$=D2$ THEN GOTO 540
510   D1=VAL(D1$[1,1]) @ D2=VAL(D2$[1,1])
512   W=0    @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
514   D1=VAL(D1$[2,2]) @ D2=VAL(D2$[2,2])
516   W=W+W1 @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
518   W=W+W1 @ IF L1=0          THEN CALL BPUNCT(B$,R,C+W,P$(), 1)
520   D1=VAL(D1$[4,4]) @ D2=VAL(D2$[4,4])
522   W=W+W2 @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
524   D1=VAL(D1$[5,5]) @ D2=VAL(D2$[5,5])
526   W=W+W1 @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
528   W=W+W1 @ IF L1=0          THEN CALL BPUNCT(B$,R,C+W,P$(), 1)
530   D1=VAL(D1$[7,7]) @ D2=VAL(D2$[7,7])
532   W=W+W2 @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
534   D1=VAL(D1$[8,8]) @ D2=VAL(D2$[8,8])
536   W=W+W1 @ IF L1=0 OR D1#D2 THEN CALL BDIGIT(B$,R,C+W,D$(),D1)
538   D2$=D1$
540 END SUB

550 ! build-time(buffer,digit-font,punct-font,row,col,d-width,p-width,curr-time,prev-time)
552 SUB BTIME(B$,D$(),P$(),R,C,W1,W2,T1$,T2$)
554   L1=LEN(T1$) @ T1$=TIME$
556   L2=LEN(T2$) @ IF L2=0 THEN T2$=T1$
558   IF L1>0 AND T1$=T2$ THEN GOTO 590
560   T1=VAL(T1$[1,1]) @ T2=VAL(T2$[1,1])
562   W=0    @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
564   T1=VAL(T1$[2,2]) @ T2=VAL(T2$[2,2])
566   W=W+W1 @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
568   W=W+W1 @ IF L1=0          THEN CALL BPUNCT(B$,R,C+W,P$(), 0)
570   T1=VAL(T1$[4,4]) @ T2=VAL(T2$[4,4])
572   W=W+W2 @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
574   T1=VAL(T1$[5,5]) @ T2=VAL(T2$[5,5])
576   W=W+W1 @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
578   W=W+W1 @ IF L1=0          THEN CALL BPUNCT(B$,R,C+W,P$(), 0)
580   T1=VAL(T1$[7,7]) @ T2=VAL(T2$[7,7])
582   W=W+W2 @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
584   T1=VAL(T1$[8,8]) @ T2=VAL(T2$[8,8])
586   W=W+W1 @ IF L1=0 OR T1#T2 THEN CALL BDIGIT(B$,R,C+W,D$(),T1)
588   T2$=T1$
590 END SUB

600 ! build-setup(buffer)
602 SUB BSETUP(B$)
604   B$=B$&CHR$(27)&"E"&CHR$(27)&"<"
606 END SUB

620 ! build-reset(buffer)
622 SUB BRESET(B$)
624   B$=B$&CHR$(27)&"E"
626 END SUB

640 ! build-frame(buffer,top-row,left-col,bottom-row,right-col)
642 SUB BFRAME(B$,R1,C1,R2,C2)
644   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
646   V$=CHR$(124) @ H$="-" @ C$="+"
648   B$=B$&FNC$(R1,C1)
650   B$=B$&C$ @ FOR C=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT C @ B$=B$&C$
652   FOR R=R1+1 TO R2-1
654   B$=B$&FNC$(R,C1)&V$&FNC$(R,C2)&V$
656   NEXT R
658   B$=B$&FNC$(R2,C1)
660   B$=B$&C$ @ FOR C=C1+1 TO C2-1 @ B$=B$&H$ @ NEXT C @ B$=B$&C$
662 END SUB

700 ! build-digit(buffer,top-row,left-col,digit-font-array,digit-index)
702 SUB BDIGIT(B$,R,C,F$(),D)
704   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
706   DEF FND$(F$,L)=F$[L*9+1,L*9+9]
708   FOR I=0 TO 6
710     B$=B$&FNC$(R+I,C)&FND$(F$(D),I)
712   NEXT I
714 END SUB

720 ! build-punct(buffer,top-row,left-col,punct-font-array,punct-index)
722 SUB BPUNCT(B$,R,C,F$(),P)
724   DEF FNC$(R,C)=CHR$(27)&"%"&CHR$(C)&CHR$(R)
726   DEF FNP$(F$,L)=F$[L*6+1,L*6+6]
728   FOR I=0 TO 6
730     B$=B$&FNC$(R+I,C)&FNP$(F$(P),I)
732   NEXT I
734 END SUB

740 ! load-digit-font-array(digit-font-array)
742 SUB LDIGIT(D$())
744   D$(0)="  #####   ##   ## ##     ####     ####     ## ##   ##   #####  " ! 0
746   D$(1)="    ##     ####       ##       ##       ##       ##    ####### " ! 1
748   D$(2)=" ####### ##     ##       ## ####### ##       ##       #########" ! 2
750   D$(3)=" ####### ##     ##       ## #######        ####     ## ####### " ! 3
752   D$(4)="##       ##    ## ##    ## ##    ## #########      ##       ## " ! 4
754   D$(5)="###########       ##       ########        ####     ## ####### " ! 5
756   D$(6)=" ####### ##     ####       ######## ##     ####     ## ####### " ! 6
758   D$(7)="###########    ##      ##      ##      ##       ##       ##    " ! 7
760   D$(8)=" ####### ##     ####     ## ####### ##     ####     ## ####### " ! 8
762   D$(9)=" ####### ##     ####     ## ########       ####     ## ####### " ! 9
764 END SUB

780 ! load-punctuation-font-array(punctuation-font-array)
782 SUB LPUNCT(P$())
784   P$(0)="  ##   ####   ##          ##   ####   ##  " ! :
786   P$(1)="     #    #    #    ##    #    #    #     " ! /
788 END SUB

900 ! hp-il-send(buffer,device-address)
902 SUB ILSEND(B$,A)
904   SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL
906 END SUB

Click on "View a Printable Version" at the bottom of the page to get a version without scrollbar.

Edit: TCP/IP configuration information added


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 11-08-2023 05:27 PM

How to upload the program with ILPER ?

Dont work..

Code:
unix2dos -v video2.txt
unix2dos: Es wurden 184 von 184 Zeilenumbrüchen umgewandelt.
unix2dos: Datei video2.txt wird ins DOS-Format umgewandelt …
Code:
wine "/home/user/.wine/drive_c/Program Files (x86)/HP-Emulators/alifhdr32/alifhdr.exe" video2.txt VIDEO2.b71 /T
then video2.b71 included into DosLink "In"
Code:
COPY :DOSLINK
Code:
CAT ALL
NAME S TYPE LEN DATE TIME PORT
FORTHRAM FORTH 22947 01/01/00 00:00
workfile BASIC 0 01/01/00 00:00
..
VIDEO2 TEXT 7936 11/08/23 18:19
(weird VIDEO2 not as basic recognized)
Code:
RUN VIDEO2
ERR:Invalid File Type

Any advice is welcome.

And putting the VIDEO.DAT from the thread into :HDRIVE1 in ILPER then download it to EMU71 (COPY VIDEO2:HDRIVE1 TO CLOCK2 then RUN CLOCK2 ) had the same error.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - rprosperi - 11-08-2023 07:14 PM

VIDEO.DAT is a lif volume. Open it using one of the virtual drives in ILPer with a 71B (real or emu) connected, in my examples drive HDRIVE1

To see the contents:
CAT :TAPE(2) (assuming using the 2nd drive of ILPer)

To copy the first program:

COPY VIDEO1:TAPE(2) to VIDEO1

To copy the 2nd program:

COPY VIDEO2:TAPE(2) to VIDEO2

I've verified this works and verified the types of files are correct (BASIC)


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 11-08-2023 08:34 PM

ok. probably the recurrent issue I have with ILPER started under linux (with wine) and some file structure coming from other systems.
Will try later with PyIlper.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 11-09-2023 03:55 AM

System setup:
  • MacBook Pro 2019 Core i9 running macOS Ventura 13.6.1
  • CrossOver 23.6 (a wrap up version of Wine 8.0.1 for macOS)
  • Windows 7 Pro 32-bit CrossOver bottle environment for HP stuff
Test setup #1
  • Emu71 v1.17 [running in CrossOver]
  • ILVideo80 v1.3 [running in CrossOver]
  • ILPer v2.4 [running in CrossOver]
    • video.dat loaded as HP9114B

    Code:
    Device      IP-address   TCP-in-port   TCP-out-port
    Emu71       localhost       60000         60001
    ILVideo80   localhost       60001         60002
    ILPer       localhost       60002         60000

Test setup #2
  • Emu71 v1.17 [running in CrossOver]
  • ILVideo80 v1.3 [running in CrossOver]
  • pyILPER v1.8.7 (Python 3.9.18 & Qt 5.15.2) [running on macOS]
    • video.dat loaded as HP9114B

    Code:
    Device      IP-address   TCP-in-port   TCP-out-port
    Emu71       localhost       60000         60001
    ILVideo80   localhost       60001         60002
    pyILPer     localhost       60002         60000

In both setup, I was able to copy the video2 program from tape to HP-71B memory and successfully execute the program.

note: pyILPer does not implement the video interface, so ILVideo80 is mandatory in this example.


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - J-F Garnier - 11-09-2023 08:11 AM

Sylvain's programs also load and run fine in Emu71/DOS w/ DOSBox !

Emu71/DOS 1.45
DOSBox 0.74-3

No particular setup, use the default DISPLAY and HDRIVEx devices in the ini file and set e.g. HDRIVE2 video.dat ,
load with COPY VIDEO2:HDRIVE2 ,
but take care to do DISPLAY IS * to avoid mixing the DISP and SEND outputs.

[attachment=12824]

Thanks Sylvain, for this great HP-71B/HP-IL demo !

J-F


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 11-09-2023 10:22 AM

Whatever happens before. It works now better.

sequence:
(on debian 64bits with all EMU71 ILPER Video80 started with wine)
video.dat into ILPER field HP9114B (not HDRIVE1 like before).
COPY VIDEO2:HP9114B
.. transfered a basic (not TEXT anymore) program VIDEO2 into EMU71.
DISPLAY IS DISPLAY under Basic prompt activated the screen video80.
Result of RUN VIDEO2 can be seen in the attachment.
It differ from the already distributed appearance.

I will have to look at why (its out at PRINTER from ILPER but not readable, and VIDEO80 as line output, and on the EMU71 screen).


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 11-09-2023 12:55 PM

(11-09-2023 10:22 AM)floppy Wrote:  DISPLAY IS DISPLAY under Basic prompt activated the screen video80.

Not correct, use DISPLAY IS * before running the program.

The external display interface does not need to be activated, the program send the strings to the external display interface directly with SEND.
904 SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL

(11-09-2023 10:22 AM)floppy Wrote:  I will have to look at why (its out at PRINTER from ILPER but not readable, and VIDEO80 as line output, and on the EMU71 screen).

The program assume that the 92198 video interface/simulator is at address 1, if not, reorganize your loop so it is.

Alternatively, you can change the target address by modifying the A variable content.
10 OPTION BASE 0 @ DELAY 0,0 @ A=1

While we are at it, add the following line to the program.
15 DISPLAY IS *


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 11-09-2023 03:36 PM

+1. Works.

NO change in the VIDEO2 program.

Changed the TCP/IP on my PC from

In Out
EMU71 6001 6000
ILPER 6000 6002
Vid80 6002 6001

to

In Out
EMU71 6001 6000
ILPER 6002 6001
Vid80 6000 6002

and in the basic prompt:
Code:
DISPLAY IS *
RUN VIDEO2



RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - floppy - 11-15-2023 11:32 AM

(11-03-2023 06:45 PM)Sylvain Cote Wrote:  904 SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL

I see you use a buffering. Is the Video command buffer B$ sensitive to blanks in the middle ?
I never had controlled an IL device with such method. However, I suppose it will accelerate the video rendering of the current Forth programms I made (clock and snake): looping continuously with the word EMIT is probably not the quickest method (HP-71 SoftDevHandbook chapter 15.7)


RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - Sylvain Cote - 11-15-2023 03:06 PM

(11-15-2023 11:32 AM)floppy Wrote:  
(11-03-2023 06:45 PM)Sylvain Cote Wrote:  904 SEND UNT UNL LISTEN A MTA DATA B$ UNT UNL
I never had controlled an IL device with such method. However, I suppose it will accelerate the video rendering of the current Forth programms I made (clock and snake): looping continuously with the word EMIT is probably not the quickest method (HP-71 SoftDevHandbook chapter 15.7)

(11-15-2023 11:32 AM)floppy Wrote:  I see you use a buffering.
Unless specified otherwise, BASIC is passing variable by reference, so B$ is a reference to the string variable of the caller.

(11-15-2023 11:32 AM)floppy Wrote:  Is the Video command buffer B$ sensitive to blanks in the middle ?
I do not understand that question, the video interface will interprete and/or output any string it receives.

(11-15-2023 11:32 AM)floppy Wrote:  However, I suppose it will accelerate the video rendering of the current Forth programms I made (clock and snake): looping continuously with the word EMIT is probably not the quickest method (HP-71 SoftDevHandbook chapter 15.7)
The video interface is a remote display, so it is slow.
The HP-71B is also slow and sometime slower that the external interface.
To get the feastest speed possible, you need to do the following:
  • read the video interface manual
  • try the different escape sequences until you completely understand the behavior of the interface
  • organize you code to minimize the bytes that need to be sent to the interface
  • organize you code to minimize the string generation time on the 71B
I am using the HP-IL protocol directly in my VIDEO2 program, you can replace it with high level BASIC commands, add/replace the following lines:

add these configuration lines
Code:
 15 DISPLAY IS * @ PRINTER IS :A @ PWIDTH INF
Code:
193 PRINTER IS *

and the SEND replacement
Code:
904 PRINT B$;

Example: the following example generate the same set of HP-IL messages

SEND UNL LISTEN 1 MTA DATA "HELLO!" UNT UNL
or
PRINT "HELLO!";
(assuming: PRINTER IS :1 @ PWIDTH INF)

Code:
UNL    (43F)  unlisten
RFC    (500)  ready for command
LAD 01 (421)  listen address 1
RFC    (500)  ready for command
UNT    (45F)  untalk
RFC    (500)  ready for command
DAB 48 (048)  data byte 'H'
DAB 45 (045)  data byte 'E'
DAB 4C (04C)  data byte 'L'
DAB 4C (04C)  data byte 'L'
DAB 4F (04F)  data byte 'O'
DAB 21 (021)  data byte '!'
UNT    (45F)  untalk
RFC    (500)  ready for command
UNL    (43F)  unlisten
RFC    (500)  ready for command



RE: (HP71B) Speed experience with Video (EMU71 and Video80 screen) - J-F Garnier - 11-15-2023 04:43 PM

(11-15-2023 03:06 PM)Sylvain Cote Wrote:  Example: the following example generate the same set of HP-IL messages

SEND UNL LISTEN 1 MTA DATA "HELLO!" UNT UNL
or
PRINT "HELLO!";
(assuming: PRINTER IS :1 @ PWIDTH INF)

Code:
UNL    (43F)  unlisten
RFC    (500)  ready for command
LAD 01 (421)  listen address 1
RFC    (500)  ready for command
UNT    (45F)  untalk
RFC    (500)  ready for command
DAB 48 (048)  data byte 'H'
DAB 45 (045)  data byte 'E'
DAB 4C (04C)  data byte 'L'
DAB 4C (04C)  data byte 'L'
DAB 4F (04F)  data byte 'O'
DAB 21 (021)  data byte '!'
UNT    (45F)  untalk
RFC    (500)  ready for command
UNL    (43F)  unlisten
RFC    (500)  ready for command

A third (and intermediate) way is to use the OUTPUT statement:
OUTPUT :1 ;"HELLO!";
that should do the same thing.

I don't know which method is the fastest, the SEND method may be slower due to the individual command decoding, but that may be marginal relative the the intrinsic slowness of the HP-IL devices.

J-F