Oricutron with serial port emulation

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
iss
Flight Lieutenant
Posts: 499
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oricutron with serial port emulation

Post by iss » Wed Sep 24, 2014 7:29 pm

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.

User avatar
Hialmar
Flight Lieutenant
Posts: 318
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Oricutron with serial port emulation

Post by Hialmar » Fri Oct 24, 2014 8:45 am

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.
Hialmar
CEO and Silicium member.

User avatar
iss
Flight Lieutenant
Posts: 499
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oricutron with serial port emulation

Post by iss » Fri Oct 24, 2014 2:51 pm

I tested with Linux and everything looks fine :). Thanks for update.

User avatar
Hialmar
Flight Lieutenant
Posts: 318
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Oricutron with serial port emulation

Post by Hialmar » Sun Oct 26, 2014 11:44 am

I tested on Windows and had to correct a few bugs but it works now.
Hialmar
CEO and Silicium member.

User avatar
coco.oric
Flight Lieutenant
Posts: 426
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: Oricutron with serial port emulation

Post by coco.oric » Tue Oct 28, 2014 5:19 am

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
coco.oric as DidierV, CEO Member
Image Image

User avatar
Hialmar
Flight Lieutenant
Posts: 318
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Oricutron with serial port emulation

Post by Hialmar » Tue Oct 28, 2014 9:04 am

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.
Hialmar
CEO and Silicium member.

User avatar
barnsey123
Flight Lieutenant
Posts: 379
Joined: Fri Mar 18, 2011 10:04 am
Location: Birmingham

Re: Oricutron with serial port emulation

Post by barnsey123 » Tue Oct 28, 2014 10:05 am

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?

User avatar
Hialmar
Flight Lieutenant
Posts: 318
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Oricutron with serial port emulation

Post by Hialmar » Tue Oct 28, 2014 11:26 am

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.
Hialmar
CEO and Silicium member.

User avatar
Dbug
Site Admin
Posts: 2368
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Oricutron with serial port emulation

Post by Dbug » Tue Oct 28, 2014 1:07 pm

Unitialized memory perhaps?
The memory state is definitely different when loading from the standard BASIC vs from Sedoric.

User avatar
iss
Flight Lieutenant
Posts: 499
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oricutron with serial port emulation

Post by iss » Tue Oct 28, 2014 1:19 pm

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?

User avatar
barnsey123
Flight Lieutenant
Posts: 379
Joined: Fri Mar 18, 2011 10:04 am
Location: Birmingham

Re: Oricutron with serial port emulation

Post by barnsey123 » Tue Oct 28, 2014 2:18 pm

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;
}

User avatar
Chema
Game master
Posts: 2068
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oricutron with serial port emulation

Post by Chema » Tue Oct 28, 2014 2:41 pm

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.

User avatar
Hialmar
Flight Lieutenant
Posts: 318
Joined: Tue Mar 04, 2014 11:25 am
Location: Toulouse, France
Contact:

Re: Oricutron with serial port emulation

Post by Hialmar » Wed Oct 29, 2014 9:07 am

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.
Hialmar
CEO and Silicium member.

Brana
Flying Officer
Posts: 151
Joined: Fri Nov 30, 2007 8:30 pm
Contact:

Re: Oricutron with serial port emulation

Post by Brana » Fri Feb 12, 2016 5:55 pm

iss wrote: * awesome Vagelis Blathras terminal program (info) and (download).
This disk file works only on Telestrat emulation, right?

User avatar
iss
Flight Lieutenant
Posts: 499
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oricutron with serial port emulation

Post by iss » Fri Feb 12, 2016 11:26 pm

It works in Atmos mode. After boot select #31C as base address.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests