Page 3 of 3

Re: Oricutron with serial port emulation

Posted: Wed Sep 24, 2014 7:29 pm
by iss
Congrats, barnsey123!
Nice work, it's playable and fun. Thanks for your effort.

Else, I can confirm DSK is not working, but TAP is perfect.

Re: Oricutron with serial port emulation

Posted: Fri Oct 24, 2014 8:45 am
by Hialmar
I have just updated the modem emulation code so that it works with IPv6.

I use getaddrinfo which has known problems in MinGW.

Solutions are given here and I will add this to the wiki :
http://programmingrants.blogspot.fr/200 ... ce-to.html

Edit: I will try to compile under Linux and Windows this evening.
I have no ways of compiling/testing under AOS4 and other such platforms.

Re: Oricutron with serial port emulation

Posted: Fri Oct 24, 2014 2:51 pm
by iss
I tested with Linux and everything looks fine :). Thanks for update.

Re: Oricutron with serial port emulation

Posted: Sun Oct 26, 2014 11:44 am
by Hialmar
I tested on Windows and had to correct a few bugs but it works now.

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 5:19 am
by coco.oric
here is HNEFATAFL ONLINE v0.6 which has been tested on Oricutron Rev:626 on Win7 x64.
Hello

Where is oricutron winx with serial update, i've find v616M without the serial function
Didier

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 9:04 am
by Hialmar
I haven't posted the WIP version yet.

You need to compile it from the sources.

I'll try to make the WIP this evening.

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 10:05 am
by barnsey123
BTW, HNEFATAFL-ONLINE still only works with oricutron using the TAP image.
I've installed latest oricutron (rev 634) and although the serial modem is ticked the DISK image still hangs.
There is no difference between the images (it's been TAP2DSK'ed) so I don't know what's happening.

Could there be some sort of conflict when using the serial port and the disk drive? Is it an oricutron thing?

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 11:26 am
by Hialmar
It's not a problem of Oricutron with Disk drive and Modem emulator because this works well with Modem.dsk (Vagelis Blathras terminal program).

No idea why it doesn't work with your tap2dsk version.

I've checked with the debugger breaking on the modem functions and your client program breaks before that while the server program hangs before entering any modem functions either.

No idea what could happen.

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 1:07 pm
by Dbug
Unitialized memory perhaps?
The memory state is definitely different when loading from the standard BASIC vs from Sedoric.

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 1:19 pm
by iss
I checked TeaForTwo converted to DSK and it hangs exactly as HNEFATAFL-ONLINE disk version.
Then checked the comm routines and didn't found anything suspicious.
Fortunately, I found a workaround - when building in osdk_build.bat use:

%OSDKBIN%\tap2dsk.exe -i"!QUIT:!HNEFATAFL" BUILD\HNEFATAFL-ONLINE.TAP HNEFATAFL-ONLINE.DSK

I'm not sure where is the real problem but first '!QUIT' then start the file - works :)
Maybe someone more familiar with Oric DOS will explain?

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 2:18 pm
by barnsey123
Yup, QUIT works. I'd just started trawling through the code looking for something stupid so you've saved me some work there. Thanks.

Here's what QUIT does:

QUIT

Resets the pointers used by the DOS, resetting the IRQ and NMI
vectors. Disables the FUNCTion keys, and makes the use of "!"
obligatory for DOS commands.

The instruction is necessary before running any program that
uses Page 4 of memory or modifies the IRQ/NMI vectors itself
.

Looked at "talk.c" which is the additional comms stuff and can't see any use of page 4 but I don't fully understand it...

Er...must make sense to someone... :wink:

talk.c

Code: Select all

#include "stdlib.h"
#include "oric.h"

unsigned char* ACIA = (unsigned char*)0x31c;
unsigned char* VIA = (unsigned char*)0x300;

extern void irq_handler(void);
extern char* clockptr;
extern char started;

unsigned char buffer[256];
unsigned char hundredths=100;
unsigned char put_ptr, get_ptr;

my_handler() {
  if (ACIA[1]&0x80) {
    if (ACIA[1]&8) buffer[put_ptr++]=ACIA[0];
  } else if ((VIA[13]&0x40) && started) {
    hundredths--;
    if (hundredths==0) {
      hundredths=100;
      if (clockptr[3]-- == '0') {
        clockptr[3]='9';
        if (clockptr[2]-- == '0') {
          clockptr[2]='5';
          if (clockptr[0]-- == '0') {
            clockptr[0]='9';
            ping();
          }
        }
      }
    }
  }
}


char receive_char(void) {
  if (put_ptr!=get_ptr) return buffer[get_ptr++];
  else return -1;
}

char wait_char(void) {
  while (put_ptr==get_ptr);
  return buffer[get_ptr++];
}

void send_char(char c) {
  while(!(ACIA[1]&0x10));
  ACIA[0]=c;
}

int carrier_detect() {
  return (ACIA[1]&0x20)==0;
}

void set_dtr() {
  ACIA[2]=ACIA[2]&0xFE | 1;
}

void init_comm() {
  chain_irq_handler(my_handler);
  ACIA[3]=0x3E; /* 9600 baud, 1 stop bit, 7 data bits */
  ACIA[2]=0x68; /* even parity, DTR=0, RTS=1 */
}

void end_comm() {
  ACIA[2]=0x60;
}

Re: Oricutron with serial port emulation

Posted: Tue Oct 28, 2014 2:41 pm
by Chema
Here without a working version of Oricutron and serial port emulation and without more data about the symptoms it is difficult to say what could happen.

I tested your program, however, on my version of Oricutron and found something that might ring bells to someone.

In my case your game hangs when asking for SERVER/CLIENT role. A little debugging brought that it hangs while issuing the getchar(), which is a simple:

Code: Select all

loop
   jsr $023b
   bpl loop
This routine in $023b simply issues a JMP to the ROM routine GTORKB in EB78 when no disk is present, but this is not the case when it is. Here it is jumping to $045b which is an indirection to some OS routine (anyone has documentation about these routines?). In the end it calls GTORKB which reads the byte at $02df which should contain the pressed key along with the Z flag set to 1 if it is 'valid'. It seems that it never gets a valid key (always 0).

If you force the read to the ascii value of 1, the program continues...

I am not sure why, but if I try to set a breakpoint at the IRQ handler at $0244 it never stops. I tried different approaches (even poking back $eb78 into the jmp at $023b) and none worked. I cannot tell what is going on: the CPU keeps waiting for a keypress. Is that the symptom you are experiencing or is it due to the fact that I am not using a version of Oricutron which supports serial port emulation?

In any case, you are issuing an init_comm at the beginning (which adds your IRQ handler routine to deal with the communication). Maybe you can wait to call that until the user has configured everything correctly (just to test)?

EDIT: I posted something completely irrelevant after the comments about the !QUIT workaround. I even did not care to read the new post warning when pressing Submit. I shall burn in hell... Sorry.

Re: Oricutron with serial port emulation

Posted: Wed Oct 29, 2014 9:07 am
by Hialmar
Just a note that I have posted new WIP binaries for Windows and OS X on Peter's website :
http://www.petergordon.org.uk/oricutron/

If there is any problem with those please drop me a PM.

Re: Oricutron with serial port emulation

Posted: Fri Feb 12, 2016 5:55 pm
by Brana
iss wrote: * awesome Vagelis Blathras terminal program (info) and (download).
This disk file works only on Telestrat emulation, right?

Re: Oricutron with serial port emulation

Posted: Fri Feb 12, 2016 11:26 pm
by iss
It works in Atmos mode. After boot select #31C as base address.