VTI board for S100 computer (Poly88, IMSAI, ...)

Requests for features
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

Hi,

I recently used Z88DK to make a demo for "VTI" board.

It's a S100 board for computers like IMSAI 8080, Altair 8800, Poly88. It was born for Poly88 but it works also for other ones.
Here is a description of the board: http://www.s100computers.com/Hardware%2 ... 0Board.htm

It has a composite video output which interfaces with a plain composite monitor (it's NOT a serial device).
It's memory-mapped, so the ouput is produced simply putting values in memory location.

The start address is by default $F800 but it can be easily changed through dip-switches in case of conflicts with other boards. Infact we changed the start address to $E800 because the default one was used by other board.
It has 64x16 character grid, The charset includes all US-ASCII chars, a bunch of 32 greek letters and 64 special 2x3 "block" characters (chars from 0x00 to 0x3f), which can reach 128x48 "pixels" resolution.

mangrap.jpg

I did a working demo and put it on github: https://github.com/sblendorio/vti-lib
You can see the result in this video: https://www.youtube.com/watch?v=v8e73I5sO7A

Could it be possibile to add support for this hardware into Z88DK project?

Here is a list of functions implemented in my library. The key functions are "vti_set_start" and "vti_plot".
  • void vti_set_start(unsigned int start);
  • void vti_print_at(int x, int y, unsigned char *msg);
  • void vti_clear_screen(void);
  • void vti_rawchar_at(int x, int y, char ch);
  • void vti_plot(char mode, int x, int y);
  • void vti_line(char mode, int x0, int y0, int x1, int y1);
  • void vti_ellipse_rect(char mode, int x0, int y0, int x1, int y1);
  • void vti_box(char mode, int x0, int y0, int x1, int y1);
  • void vti_boxfill(char mode, int x0, int y0, int x1, int y1);
  • char vti_read_pixel(int x, int y);
  • unsigned char vti_read_char(int x, int y);
  • void vti_scroll_up(int n);
  • void vti_scroll_down(int n);
  • void vti_put_shape(int x, int y, char **shape, int w, int h);
You do not have the required permissions to view the files attached to this post.
Last edited by sblendorio on Thu Jan 21, 2021 6:07 pm, edited 1 time in total.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

That looks really easy to incorporate (memory mapped character displays are a doddle to work with!) - very similar in workings to a few other targets.

The best way to pull this in is to provide the following:

1. An implementation of generic_console - the Kramer MC version will be very similar with a 64x16 display
2. Plotting can then be done using the textpixl6/gfx6 interface - the trs80 has a similar 2x3 graphics matrix

Given it's multi-platform, it's probably best to stick it in libsrc/video and create a vti library that can be linked to the different targets. The start address will change so that needs to be an externalised value that can be overridden on the command line/crt0: you can see something similar with the CRT_FONT variable for the +zx.

There will be a bit of jiggery around ensuring the "portable" graphics are pulled in - after I've fixed your strtol() problem I'm happy to setup the basic structure - I've not figured out the right command lines for the S100 bus on mame yet so it'll be untested.
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

The test can be done by me and my friend Andrea Matteucci.

The key function is just this, to draw a dot.

mode =
  • 0 = erase
  • 1 = plot
  • 2 = xor

Code: Select all

static unsigned char pow[] = {32, 16, 8, 4, 2, 1};
 
void vti_plot(char mode, int x, int y) {
    static unsigned char *addr;
    static int gx, gy;
    static unsigned char sx, sy, mask, value;
    if (x > 127 || y > 47) return;
    gx = x / 2;
    gy = y / 3;
    sx = x % 2;
    sy = y % 3;
    mask = pow[3*sx + sy];
    addr = vti_start + gx + (64*gy);

    value = *addr;
    if (value & 0x80) value = 0x3f;

    *addr =
          mode == 1 ?
            value & (~mask)
        : mode == 0 ?
            value | mask
        : // mode = 2 -> XOR mode
            (~value & mask ? value | mask : value & (~mask));
}
Last edited by sblendorio on Thu Jan 21, 2021 6:09 pm, edited 3 times in total.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

I notice vti_set_start() is not strictly necessary, the page address (we often set on base_graphics) depends on the hw configuration.
"Starting address is $F800 by default, but it can be changed using dip-switches."
Is there a way to detect the current board setting?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

I've added a new library -lgfxvti which when added to your compile line will switch over to using the memory mapped VTI as the display driver.

The memory defaults to the standard address so you'll need to add:

Code: Select all

-pragma-export:VTI_DISPLAY=0xe800
to the compile line. The library provides:

* --generic-console which is classic's standard VT52+ terminal
* 128x48 graphics using the gencon as the display driver
* Graphics primitives (lines, boxes, circles) and bunch of other operations

The only testing I've done is to make sure programs link without error on the Altair8800 target.

Not much magic was needed (though I did need to de-z80 one file), so the change should be easy to follow: https://github.com/z88dk/z88dk/commit/8 ... 4d202ee820 and you'll be able to fix up any bugs (knowing me there will be some)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

beautiful !
..I wonder if a CP/M variant is feasible/useful ?
I'm not asking to have it, I'm curious
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

@Stefano AFAIK there is no way to detect the start address of VTI, since there are hardware dip-switches to set it. I'm looking through documentation.

Here is a board description:
https://deramp.com/polymorphic-computers/boards.html

Here is the manual:
https://deramp.com/polymorphic-computer ... ly_VTI.pdf

Here is the manual for interfacing the board with a TTL keyboard:
https://deramp.com/polymorphic-computer ... rd_III.pdf
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

dom wrote: Wed Jan 20, 2021 11:18 pm and you'll be able to fix up any bugs (knowing me there will be some)
I spotted one of course, I'll fix it up this evening.
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

@Dom could you also provide an "hello world" (a dot, a line...) which could run under CP/M and the command line to be used to build it?
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

Suggestion for testing.

This is Antonino Porcino's emulator for General Processor, configured to be used with VTI, mapped at address $C000(hex) 49152(dec)

https://nippur72.github.io/gpmodelt-emu/?poly88=true

After the prompt appears A>, just drag'n'drop file demo.com from my github repository into the browser window and launch it with:

A>DEMO 49152

Screenshot from 2021-01-21 17-21-51.png
You do not have the required permissions to view the files attached to this post.
Last edited by sblendorio on Thu Jan 21, 2021 4:48 pm, edited 1 time in total.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

Ah, awesome, I love his emulators - so easy to use! That makes life much easier - I'll hopefully get it all working tonight.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

So, it turns out that I can't read. All sorted now though, so some screenshots:

A very messy mandelbrot (from examples/graphics/mandel.c):
Screenshot 2021-01-21 at 18.37.33.png
Compile with:

Code: Select all

zcc +cpm -clib=8080 mandel.c -lgfxvti -pragma-define:CONSOLE_COLUMNS=64 -pragma-define:CONSOLE_ROWS=16 --generic-console -pragma-export:VTI_DISPLAY=0xc000 -lndos --math-dai32
We're using the maths library extracted from the DAI32 to provide an 8080 floating point library.

Line drawing and circles:
Screenshot 2021-01-21 at 18.41.04.png
From this code:

Code: Select all

#include <graphics.h>
#include <stdio.h>

int main()
{
        clg();

        draw(0,0,128,63);

        circle(30,30,20,1);
        circle(30,30,28,1);

        fgetc_cons();
}
And the following command line:

Code: Select all

zcc +cpm -clib=8080 test.c -lgfxvti -pragma-define:CONSOLE_COLUMNS=64 -pragma-define:CONSOLE_ROWS=16 --generic-console -pragma-export:VTI_DISPLAY=0xc000
The key options are:

* --generic-console This option switches printing over from BDOS to the memory mapped display
* -pragma-define:CONSOLE_COLUMNS=64 -pragma-define:CONSOLE_ROWS=16 placeholders to define the size of the screen (they're not actually used, so I want to remove them in this case)
* -pragma-export:VTI_DISPLAY=0xc000 - sets the memory address
* -lgfxvti - link the library in

You should be able to use your ellipse box function just by replacing vti_plot() with plot() etc
You do not have the required permissions to view the files attached to this post.
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

@dom are there also corresponding for:

* vti_print_at (print strings at x,y text coordinates)
* vit_read_pixel (read pixel status)
* XOR version of plot

?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

sblendorio wrote: Fri Jan 22, 2021 9:27 am @dom are there also corresponding for:

* vti_print_at (print strings at x,y text coordinates)
* vit_read_pixel (read pixel status)
* XOR version of plot

?
Sure:

* vti_print_at -> gotoxy(x,y); printf("...."). <conio.h>
* vti_read_pixel -> point(x,y) <graphics.h>
* XOR -> xorplot(x,y) <graphics.h>
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

A Z80 variant is possible (and capable of little more things) . Was / is it a reasonably frequent case?
sblendorio
Member
Posts: 20
Joined: Tue Jan 19, 2021 9:03 am

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by sblendorio »

I just tried to compile this
demo.zip
with this command line, it worked with the Nino Porcino's emulator (vti start addres = 0xc000).

Code: Select all

zcc +cpm -clib=8080 demo.c -lgfxvti -pragma-define:CONSOLE_COLUMNS=64 -pragma-define:CONSOLE_ROWS=16 --generic-console -pragma-export:VTI_DISPLAY=0xc000 -o demo.com
Then I recompiled it with start address = 0xe800 (the address used by my friend's IMSAI), then sent it to my friend (I don't have an IMSAI).

Code: Select all

zcc +cpm -clib=8080 demo.c -lgfxvti -pragma-define:CONSOLE_COLUMNS=64 -pragma-define:CONSOLE_ROWS=16 --generic-console -pragma-export:VTI_DISPLAY=0xe00 -o demo.com
Strangely, the IMSAI hangs up, it crashes and it's no more possibile to return to CP/M prompt.

Maybe some non-8080 (but Z-80 only) opcode in the com file?
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

Can you add the -m option to the command line and then post the binary and the .map file that's created so that I can check?

I don't think there should be any non-8080 code (assuming that the library is being assembled with the right flags), but it's possible. Did anything display at all? I'm guessing the original demo.com ran correctly on the IMSAI so the z88dk programs do work.

EDIT: I've just spotted it, that's annoying....the ldir in cls hasn't been replaced and jrs are still in there.

I'll commit this evening, but if you're on Linux/Mac then it's fairly trivial change:

0. cd libsrc
1. Edit Makefile
2. Change the line: TARGET=vti TYPE=8080 $(LIBLINKER) -m8080 -DFORvti -x$(OUTPUT_DIRECTORY)/gfxvti @$(LISTFILE_DIRECTORY)/video/vti/video_vti.lst - note the -m8080 option!
3. rm video/vti/*/*.o gfxvti.lib
4. make gfxvti.lib
5. cp gfxvti.lib ../lib/clibs/

And then rebuild.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

Good, as usual the real hardware is the real challenge :)

..a next candidate could be the VIO card.
https://www.z80cpu.eu/mirrors/www.autom ... index.html
Has it been emulated ever?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

I think imsaisim supports it, but I can't spot the actual code at the moment.

Should be fairly similar to this VTI library.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

The firmware sources:
https://www.autometer.de/unix4fun/z80pa ... viofm1.asm

toz80.awk could make it more (or less) readable :)
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

stefano wrote: Fri Jan 22, 2021 1:28 pm..a next candidate could be the VIO card.
https://www.z80cpu.eu/mirrors/www.autom ... index.html
Has it been emulated ever?
Don't set me these challenges...
Screenshot 2021-01-22 at 19.56.56.png
Actually, no, please do...
Screenshot 2021-01-22 at 20.22.42.png
So in summary:

Code: Select all

zcc +cpm -clib=8080 --vio test.c -subtype=z80pack -create-app
Will create a .dsk file suitable for loading into z80pack running imsaisim. The graphics and text will be output to the VIO display module.

Since that's a handy short hand notation, the equivalent (albeit without creating a disc image) for VTI graphics is:

Code: Select all

zcc +cpm -clib=8080 --vti -pragma-export:VTI_DISPLAY=0xNNNN test.c
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

Impressive, you're becoming really fast !
I wonder if one of the fill() versions, dfill2(), can be used in the 8080 library.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by dom »

And to complete? the "V" cards, I've added a library for the Altair 8800 VDM-1 video card. Just add --vdm to the command line.
Screenshot 2021-01-22 at 23.57.41.png
As can be seen it's mainly a text video card, so the graphics are really lores (just 64x16 pixels).
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

:)
This is a very nice options set.
On the "just text" devices, I was surprised by the reasonably intelligible effect you can achieve with the normal text symbols, like " ',| ' to double the vertical resolution.
I think one of the kaypro devices works in that way.
DXOzqFYXUAE9fu0.jpg
You do not have the required permissions to view the files attached to this post.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: VTI board for S100 computer (Poly88, IMSAI, ...)

Post by stefano »

more?
(I'm just listing / blogging them, it's not a request)

SolidState Music
VB1-B:
http://dunfield.classiccmp.org/s100c/ssm/vb1b.pdf
http://www.s100computers.com/Hardware%2 ... 0VDB-1.pdf
VB1-C: http://dunfield.classiccmp.org/s100c/ssm/vb1c.pdf

Objective Design PGC (UDG mod for S100 video cards, had a socket to replace the CharGen ROM): http://www.s100computers.com/Hardware%2 ... Manual.pdf
(pg.79): https://archive.org/details/byte-magazi ... 256+matrox

Superbrain II: ftp://bitsavers.informatik.uni-stuttgar ... 198302.pdf

CompuPro Spectrum: http://www.s100computers.com/Hardware%2 ... manual.pdf

Cromemco dazzler:
http://www.s100computers.com/Hardware%2 ... 201979.pdf
http://www.s100computers.com/Hardware%2 ... 0Games.pdf

Cromemco SDI:
http://www.s100computers.com/Hardware%2 ... Manual.pdf

Digital GroupTVC32: https://bytecollector.com/archive/digit ... 32char.PDF
Digital GroupTVC64: https://bytecollector.com/archive/digit ... ew_ver.pdf

Itacha display card: http://www.s100computers.com/Hardware%2 ... 20Card.pdf

Miniterm Associates "Merlin":
http://www.s100computers.com/Hardware%2 ... Manual.pdf
http://www.s100computers.com/Hardware%2 ... Manual.pdf

Matrox ALT-256, ALT-2480:
http://www.s100computers.com/Hardware%2 ... Manual.PDF
(pg.26) https://archive.org/details/byte-magazi ... 256+matrox
http://worldphaco.com/uploads/MATROX_ALT256.pdf

SCION "Micro Angelo MA-512" : http://www.s100computers.com/Hardware%2 ... Manual.pdf

SimplyWay VDB-A: http://www.s100computers.com/Hardware%2 ... 0Board.pdf

SD System VDB 8024: https://www.retrotechnology.com/herbs_stuff/sdbios.zip
http://www.s100computers.com/Hardware%2 ... DB8024.pdf


TDL VDB-2: http://www.s100computers.com/Hardware%2 ... 0Board.pdf

Vector Graphic Flashwriter II (pg. 3.8): http://www.s100computers.com/Hardware%2 ... r%20II.pdf
http://www.hartetechnologies.com/manual ... l_Rev3.pdf
http://www.hartetechnologies.com/manual ... l_Rev4.pdf

HeathKit Z100 (page 10.5 shows how to switch btween 8086 and 8085): http://www.s100computers.com/Hardware%2 ... rt%202.pdf

Lomas "Color Magic", CGA PC compatible (should be able to work with other CPUs than 8086 when properly jumpered): http://www.s100computers.com/Hardware%2 ... Manual.pdf
CompuPro PC-Video (as above): http://www.s100computers.com/Hardware%2 ... Manual.pdf
Post Reply