Tatung Einstein

Discussion about other targets
Post Reply
athame
New member
Posts: 2
Joined: Wed Sep 14, 2011 12:17 am

Tatung Einstein

Post by athame »

Hi,

Ha we're still around. I still use my Tatung TC01 as a Z80 dev platform almost daily- probably the finest Z80 dev machine ever made - but enough oozing - I'm a total newbie to the site -I'm pretty familiar with my machine which is close but not quite up to the MSX spec.
it has a quirky ROM which is paged in and out of the first 16k of RAM
as required. There is 64k RAM total.
Graphics are colour on a TMS9129 with 32/40 col modes. There is a kludged 80 column mono card using the same chipset as the beeb.
On start up the Einey tries to boot the first 2 sectors off any disk you shove in it and drops into a ROM driven z80 monitor if you don't put a disk in. It runs a true z80 CP/M 2.2 clone Xtal Dos with a 52k tpa. It used 3 inch Floppy disks but mine is modded to use 3.5 720k as are most machines still in use.

Can anyone help a complete newb with how to go about porting for this machine please? :)

Phil
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Welcome !

Eerm, have you looked here ?
http://www.z88dk.org/wiki/doku.php?id=platform:einstein
athame
New member
Posts: 2
Joined: Wed Sep 14, 2011 12:17 am

Post by athame »

Hi,

No I hadn't - I'm not sure how I would have found it without your link.
Thanks - I'll have fun with this I'm sure:)

Phil
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Hope so :)
Sorry for the telegraph-style, please feel free to ask, when you'll be stuck ;)
RobertK
Well known member
Posts: 199
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

On the Tatung Einstein, the -lm floating point library currently seems to interfere with the generic console, you get a broken screen when you run the program.
With the native console, it works correctly, and surprisingly also when runnnig the Generic Console on the TK02 80-column screen.

Please check this. I think we had such a similar problem before with the Galaksija target.

Try it with my float test program...

Code: Select all

// Floating point calculation test
// Author: RobertK, 2018-12-29

#include <stdio.h>

void main()
{   
  printf("\nhello world\n");
  printf("\npress any key to calculate 5*0.1...\n");
  fgetc_cons();        // wait for keypress          
  printf("\n5*0.1 is %.1f\n",5*0.1);
  printf("\npress any key to exit...\n");  
  fgetc_cons();        // wait for keypress          
}
...and this luxury compilation batch file.

Code: Select all

setlocal
rem Set your z88dk root path here
set z88root=C:\Misc\z88dk\

set path=%PATH%;%z88root%bin\
set zcccfg=%z88root%lib\config\
set z80_ozfiles=%z88root%lib\

del fct_einstein.dsk
del fct_einstein.com

REM Here we define "__EINSTEIN__" so that we know what CP/M machine our program is running on

zcc +cpm -subtype=einstein -lm -pragma-redirect:fputc_cons=fputc_cons_generic -o FCT.COM floatcalctest.c -create-app -D__EINSTEIN__

endlocal

ren fct.dsk fct_einstein.dsk
ren fct.com fct_einstein.com

rem pause
User avatar
dom
Well known member
Posts: 1195
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

That's quite odd. I'll take a look when I've finished what I'm currently working on - probably a couple of days or so.
User avatar
dom
Well known member
Posts: 1195
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

That broke in a way which I didn't expect.

It seems that there were two issues:

- On the other VDP platforms, we force VDP mode 2 on startup. But on the Einstein it looked like it was defaulting to mode 0 but not setting up the VDP registers correctly. I've added a switch to mode 2 on startup.
- The second issue was that switching VDP modes wasn't being passed onto the VDP driver.

Hopefully working code will be producible from the nightly tomorrow. Apologies for having broken it.
RobertK
Well known member
Posts: 199
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

No problem at all, thank you for fixing it! Now it works fine.
RobertK
Well known member
Posts: 199
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

I've noticed that when clearing the screen on the Einstein (in 40-column mode), something red stays in the top left part of the screen:

Image

While we are at it (I don't want to open a new topic), on the ABC 80 only part of the screen gets cleared:

Image

A test program to reproduce this:

Code: Select all

/*
        cst.c - Clear Screen Test
        Author: RobertK, 2020-01-20
        
        Compile with:
        
        zcc +abc80 -pragma-redirect:fputc_cons=fputc_cons_generic -subtype=hex -create-app -o cst_abc80 cst.c
        zcc +cpm -subtype=einstein -pragma-redirect:fputc_cons=fputc_cons_generic -o CSTEST.COM cst.c -create-app -D__EINSTEIN__
                
*/

#include <stdio.h>

#if defined(__SV8000__)
        #define NO_KEYBOARD 1
#endif

#if defined(__SV8000__)
        #define TEXT_FILL_CHARACTER "X"
#else
        #define TEXT_FILL_CHARACTER "x"
#endif


void myCls()        // Clear the screen (generic or VT100 console)
{
        printf("%c",12);
        printf("\x0c");  // the "\x0c" (0x0c character) resets the cursor position to the top left corner
}
        
void FillScreen()        // Fills the screen with characters
{
        int XScreenSize,YScreenSize;        // dimensions of the text screen
        int x,y;        

        myCls();        // Clear the screen
        // determine text screen size
        screensize(&XScreenSize, &YScreenSize);

        gotoxy(2,2);
        printf("filling the screen...");
        
        // Fill the screen using the character "x"
        // On some systems we must not print at the bottom line because this would make the screen scroll
        for (x = 0; x <XScreenSize; ++x)
                for (y = 0; y <YScreenSize; ++y)
                {
                        gotoxy(x,y);
                        printf(TEXT_FILL_CHARACTER);
                }
}

void main()
{        
                        
        FillScreen();

        #if defined(NO_KEYBOARD)
                msleep(3000);
        #else
                gotoxy(2,2);
                printf("press any key");        
                gotoxy(2,3);
                printf("to clear screen...");        
                fgetc_cons();        // wait for keypress
        #endif        
        
        myCls();        // Clear the screen        
        
        msleep(1000);        // Wait one second

        #if defined(NO_KEYBOARD)
                gotoxy(2,2);
                printf("screen cleared...");        
                msleep(3000);
        #else
                gotoxy(2,2);
                printf("press any key to exit...");        
                fgetc_cons();        // wait for keypress
        #endif        
                        
        myCls();        // Clear the screen        
        return;
}
User avatar
dom
Well known member
Posts: 1195
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've corrected the abc80 issue now.

The Einstein looks like it was an issue in mode 1 and mode 2 only - the 32 column modes - the sprites end up being mapped into a region of memory that already had data. I've now cleared the memory down so the red blob goes away.
RobertK
Well known member
Posts: 199
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Both issues are fixed now, thank you, I have updated my Mastermind RK game.
Post Reply