Tic Tac Woe

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Tic Tac Woe

Post by DanDoore »

I am trying to have a go at getting Marcello Zaniboni's AI Tic Tac Toe https://www.marcellozaniboni.net/zxaittt/index.html working under the recently pimped-up SAM Coupé target but am getting screen corruption when running it, so I went back to the original ZX target and it seems to do the same, albeit in a slightly different way:

ZX: https://www.dropbox.com/s/ka7xfvx5l72qddo/ttt.png?dl=0

SAM: https://www.dropbox.com/s/1x8vzcu76dt7s ... 4.png?dl=0

It clearly used to compile and work under Z88DK (albeit in 2005) so is the code abusing something in Z88DK's printing routines - I can't see it doing anything paticulary naughty - or just plain broken?

Dan.
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

Went and had a run and thought about this - I think it's this section:

Code: Select all

/* print an int at column c and row r */
void printIntAt(int c, int r, int value) {
    #if defined SPECTRUM 
        signed char buffer[5];
        itoa(buffer, value,0);
        printAt(c, r, buffer);
    #else
        printf("\nFIX ME! (%d)\n", value);
    #endif
}
It doesn't like the itoa() bit - If I replace it with a copy of the printAt(c, r, string) routine but for integers it's fine.

Onwards...

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

Re: Tic Tac Woe

Post by stefano »

That's due to a closer compliance to the POSIX C syntax, itoa() now works the way it should ;)
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

Now working and building with appmake for ZX :)

SAM Coupé version is nearly done, just need to test get a screen loading in manually (no support in appmake for this yet but request in) and then I'll pop it up on GitHub...
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

Ack, the SAM one seems to force MODE 4 on startup which breaks loading the screen (which is MODE 3) and the text size, will raise a ticket.
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

Fixed :-)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: Tic Tac Woe

Post by stefano »

beautiful, Marcello (and Luciano) will love it!
User avatar
DanDoore
New member
Posts: 9
Joined: Sun May 02, 2021 1:50 pm

Re: Tic Tac Woe

Post by DanDoore »

It's up!

Still need to make the build less clunky but that involves using other hacky tools (https://github.com/dandoore/mgtman) which can't do everything yet as I can't use appmake to build it yet (enhancement ticket is in :)

https://github.com/dandoore/danscstuff/tree/main/aittt
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Tic Tac Woe

Post by cborn »

Hi
About mgtman
is it possible that you use the internal variable names for the header info?
then i would like to try to make a plusd version from there.
if possible.
cheers
Post Reply