home *** CD-ROM | disk | FTP | other *** search
- {
- These procedures perform direct I/O with the color/graphics adapter.
-
- video_signal - turns the video signal on / off to prevent "snow"
- during I/O operations: "true" parameter means "on"
- "false" parameter is "off".
-
- video_cursor - moves the cursor to a given row and column, sets
- cursor display on/off, and modifies cursor type to
- one of three preset formats: 0=standard, 1=block,
- 2=underscore.
-
- video_putstr - writes a character string directly to the video RAM,
- beginning at a specified row and column. Note that
- output will not wrap to the next row if the string is
- too long.
-
- video_setattr - sets the attribute bytes directly in the video RAM,
- beginning at a specified row and column for a given
- length.
-
- video_write - writes the current video page to the screen file.
- Each page in the file is numbered from 0 to the
- maximum stored (depends on disk space, 4K per page).
- It is the user's responsibility to ensure pages are
- sequential on the file, i.e., that page numbers are
- not skipped when the file is written-to; otherwise
- errors will occur.
-
- video_read - reads a page from the screen file into the current
- video page. It is the user's responsibility to
- ensure that the page number requested has, in fact,
- been written to the file.
-
- The user must also open and close the video_file.
-
- Written and placed in the public domain by
- Glen F. Marshall
- 1006 Gwilym Circle
- Berwyn, PA 19312
- }
- type
- video_byte = array[0..1] of byte;
- video_col = array[1..80] of video_byte;
- video_row = array[1..25] of video_col;
- video_page = array[0..3] of video_row;
-
- var
- video_file: file;
- video_base: integer absolute $0000:$0463;
- video_mode: byte absolute $0000:$0465;
- video_ram: video_page absolute $B800:0000;
-
- procedure video_signal(sw:boolean);
- begin
- case sw of
- true: port[video_base+4] := video_mode;
- false: port[video_base+4] := video_mode and $F7;
- end;
- end; {video_signal}
-
- procedure video_cursor(var row, col: byte; sw: boolean; form: byte);
- var
- cursor_1, cursor_2: byte;
- begin
- gotoxy(col,row);
- case sw of
- true: begin
- case form of
- 1: cursor_1 := $00;
- 2: cursor_1 := $07;
- else cursor_1 := $06;
- end;
- cursor_2 := $07;
- end;
- false: begin
- cursor_1 := $20;
- cursor_2 := $00;
- end;
- end;
- port[video_base] := $0A;
- port[video_base+1] := cursor_1;
- port[video_base] := $0B;
- port[video_base+1] := cursor_2;
- end; {video_cursor}
-
- procedure video_putstr(var row, col: byte; var str; var attr: byte);
- external 'video_io.bin';
-
- procedure video_setattr(var row, col, len, attr: byte);
- external video_putstr[3];
-
- procedure video_write(var page_no: byte);
- begin
- seek(video_file,page_no shl 5);
- video_signal(false);
- blockwrite(video_file,video_ram,32);
- video_signal(true);
- end; {video_write}
-
- procedure video_read(var page_no: byte);
- begin
- seek(video_file,page_no shl 5);
- video_signal(false);
- blockread(video_file,video_ram,32);
- video_signal(true);
- end; {video_read}