Stealing Hatari code

A place to discuss current and future developments for STeem

Moderators: Mug UK, Steem Authors, Moderator Team

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Stealing Hatari code

Postby Steven Seagal » Thu Aug 18, 2011 9:26 pm

Hello

The fact is that Hatari runs some programs that Steem can't. So, faithful to my "copy & paste" method, I've been trying to integrate some Hatari code into Steem to help the border trick detection.

Image

I don't how I would feel myself about it if it was my code (both Hatari & Steem), so I'd like to know the point of view of Hatari authors, the Steem authors, and others. A way to go? A way to forget?

Until now, it's not really working anyway. By a stroke of luck, I got Enchanted Land to "work" without patch (both STE & STF modes), but with a shimmering line just below the status bar: (edit: this has been fixed)

Image

It doesn't do all the complex things explained in the Hatari source.
Last edited by Steven Seagal on Sat Sep 03, 2011 6:31 pm, edited 1 time in total.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

wheeel
Atariator
Atariator
Posts: 28
Joined: Thu Aug 30, 2007 12:11 pm

Re: Stealing Hatari code

Postby wheeel » Thu Aug 25, 2011 7:19 am

Steven Seagal wrote:I don't how I would feel myself about it if it was my code (both Hatari & Steem), so I'd like to know the point of view of Hatari authors, the Steem authors, and others. A way to go? A way to forget?


I'm not part of either the Hatari or Steem teams, but speaking as an "other", I can't see it as a bad thing -- best of both worlds maybe?

What I would like, however, if you are happy, would be that you might post onto this forum the patches you have already made (e.g. on your other thread). I don't know whether the Steem authors are accepting new patches or not, but it would be nice if you are able to share the changes you have made?...

Thanks!

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Mon Aug 29, 2011 6:57 pm

I'll make "my" current build available, but only when I have fixed some problems. For example, Lethal Xcess is broken right now.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sat Sep 03, 2011 6:29 pm

In some cases, using the option gives horrible results. For example in Punish Your Machine (intro), it's worse than without. [edit: fixed]
Yet I think the demo runs fine in Hatari, so I'm giving them a bad name. Maybe I shouldn't name them, be more generic, like "Alternative Video Timers".
Last edited by Steven Seagal on Sat Sep 17, 2011 8:08 am, edited 1 time in total.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 412
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

Re: Stealing Hatari code

Postby thothy » Sun Sep 04, 2011 6:47 pm

As long as you follow the license rules of Hatari (GPLv2 or later), and this does not clash with the licence of the target (i.e. STEEM licence), you can certainly re-use the source code. But I would prefer if you could rather use the term "Alternate timings" or something similar instead of "Hatari timings" there.

User avatar
Steem Authors
Steem Developer
Steem Developer
Posts: 540
Joined: Tue Apr 30, 2002 10:34 pm
Location: UK
Contact:

Re: Stealing Hatari code

Postby Steem Authors » Thu Sep 15, 2011 9:12 pm

I would say it's not "stealing" when the code is freely available - as long as you make combined code available for download with the binary, e.g. by branching the Steem SVN repository.

I'd agree about not mentioning "Hatari" on the UI... might be an insult to them!

For us original developers it is not losing a daughter but gaining a son :)

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11623
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Stealing Hatari code

Postby wongck » Fri Sep 16, 2011 12:47 am

I am sure some big commercial software company use these type of technique to improve their product.
It's not the code that gets stolen, it's the idea... you just need the idea/logic and you can write the code in any old way you want into your application.
My Stuff: FB/Falcon CT63+CTPCI ATI R7500 14+512MB 30GB HDD CF HxC_SD EtherNEC/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sat Sep 17, 2011 8:06 am

OK, thanks for the replies in this and the other thread.
From the answers, especially from the emulator authors, I gather that:
- I have the permission to do that.
- I'd better not name Hatari.
- I should make the source code available (embarrassing!)
- It's not the best method.
- Hence I'd better "branch" it rather than push the mods in the current build. It's better so anyway as I'm continuously changing the code. I'll try to figure out the SVN upload thing without messing it all...
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sun Apr 29, 2012 8:43 am

So the current version SSE 3.3 integrates Hatari code in a nice non-intrusive way.
It was much fun and very instructive at the same time, a great way to get going, a challenge too. I regret it wasn't appreciated.

This integration is a liability too, a (limited) drag on performance running 2 systems, dependence on the Hatari system, etc.

Now that I understand far more about emulation and both emulators, I'm removing the dependency. This build is losing some fat, contrary to a certain actor. Of course, some tricks in Steem still are inspired by Hatari, but there will be no explicit code use in v. 3.4.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Cyprian
Atari God
Atari God
Posts: 1331
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Stealing Hatari code

Postby Cyprian » Sun Apr 29, 2012 10:13 am

Hi Steven,
It seems that we lost Steem with debugger. Do you plan to publish it on your website?
many thanks for your great job.
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sun Apr 29, 2012 10:25 am

Yes if there is a demand for it, with next version, maybe on an apart screen to avoid confusion (not everybody knows what it is).
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Cyprian
Atari God
Atari God
Posts: 1331
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Stealing Hatari code

Postby Cyprian » Sun Apr 29, 2012 11:47 am

definitely, there is strong demand :)
many thanks
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sat Jul 20, 2013 8:16 am

I've always been straightforward about this, but just in case, I've checked Hatari 1.7.0, and see many interesting things.

- ACIA low-level bit by bit, I think it's over the top!, I don't intend to replicate it in Steem right now.

- Improvements in MFP/exception (IACK cycles) seem more practical, I'll certainly try and take advantage of those at some point, depending on how hard it is to port in Steem.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1481
Joined: Sun Jul 31, 2011 1:11 pm

Re: Stealing Hatari code

Postby Eero Tamminen » Sat Jul 20, 2013 1:50 pm

thothy wrote:As long as you follow the license rules of Hatari (GPLv2 or later), and this does not clash with the licence of the target (i.e. STEEM licence), you can certainly re-use the source code.


According to:
http://steem.atari.st/licence.htm

Steem is licensed under GPL v3 which is compatible with Hatari's GPL v2 or later license.
(Without the "or later" part, Hatari license wouldn't be compatible with Steem license.)

GPL license requires that binary distribution is accompanied with (offer for) sources.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sat Jul 20, 2013 4:11 pm

Eero Tamminen wrote:According to:
http://steem.atari.st/licence.htm

Steem is licensed under GPL v3 which is compatible with Hatari's GPL v2 or later license.
(Without the "or later" part, Hatari license wouldn't be compatible with Steem license.)

GPL license requires that binary distribution is accompanied with (offer for) sources.


Yeah but when you use the concept, not the code itself, it's fuzzier than the bits of the Dungeon Master disk (lol...)
So the best is to mention where I got which concept if it's not from me.

For example in the release text file:

- Seven Gates Of Jambala (Timer B - from Hatari) (3.3)
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

Hippy Dave
Atari Super Hero
Atari Super Hero
Posts: 515
Joined: Sat Jan 10, 2009 5:40 am

Re: Stealing Hatari code

Postby Hippy Dave » Sat Jul 20, 2013 7:00 pm

Steem has the GPL version 3 license.
Hatari has the GPL version 2, or at your option any later version license.

Steem can take code from Hatari.
Hatari cannot take code from Steem.

(Hatari can be forked to the GPL version 3 license)

Concepts must be covered with a current patent to be hoarded.

Copyright should be properly attributed.

Note that Copyright, Patent, and License are three separate legal matters.


Steem would attract more GPL developers when someone GPL'izes every GPLv3 file.
As an example:

/*---------------------------------------------------------------------------
FILE: archive.cpp
MODULE: Steem
DESCRIPTION: This file contains the code for zipclass, Steem's abstraction
of the various unarchiving libraries it can use.

This file is distributed under the GNU Public License, version 3.
---------------------------------------------------------------------------*/

Also, it would be nice to have Steem's open source announcement included in Steem's /doc directory.

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sun Jul 28, 2013 7:26 pm

Hippy Dave wrote:Steem has the GPL version 3 license.
Hatari has the GPL version 2, or at your option any later version license.

Steem can take code from Hatari.
Hatari cannot take code from Steem.


This is insane.

Steem would attract more GPL developers when someone GPL'izes every GPLv3 file.
As an example:

/*---------------------------------------------------------------------------
FILE: archive.cpp
MODULE: Steem
DESCRIPTION: This file contains the code for zipclass, Steem's abstraction
of the various unarchiving libraries it can use.

This file is distributed under the GNU Public License, version 3.
---------------------------------------------------------------------------*/

Also, it would be nice to have Steem's open source announcement included in Steem's /doc directory.


I added the GPL3 licence text in steem/doc/SSE, it's a start.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Mon Sep 30, 2013 6:58 pm

I did it again...
Getting bored with the slow boot in STE mode, and since this was in hatari, I copied the patch "no dma boot".
:roll:

This part in tos.c

Code: Select all

  { 0x106, -1, pszDmaBoot, TP_HDIMAGE_OFF, 0xE00576, 0x610000E4, 4, pNopOpcodes }, /* BSR.W $E0065C */

  { 0x162, -1, pszDmaBoot, TP_HDIMAGE_OFF, 0xE00576, 0x610000E4, 4, pNopOpcodes }, /* BSR.W $E0065C */
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1481
Joined: Sun Jul 31, 2011 1:11 pm

Re: Stealing Hatari code

Postby Eero Tamminen » Mon Sep 30, 2013 8:59 pm

Steven Seagal wrote:
Hippy Dave wrote:Steem has the GPL version 3 license.
Hatari has the GPL version 2, or at your option any later version license.

Steem can take code from Hatari.
Hatari cannot take code from Steem.


This is insane.


Well, licenses can be incompatible (and they often are). If you license your code additions to STEEM under "GPL v2 or later" license, they can be used both in STEEM and Hatari. AFAIK the main difference of GPL v3 from v2 are some legal clarifications (I've understood v2 terminology etc to be US-centric), restrictions on patents & "tivoization".

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Thu Oct 10, 2013 6:55 pm

I did it again...

Running checks I realised a hack for Audio Artistic Demo (music speed) breaks ST Magazine STE Demo (Stax 65).

So I finally copied the "patch Timer D" of Hatari.
:roll:
This part in mfp.c

Code: Select all

      if (ConfigureParams.System.bPatchTimerD && !bAppliedTimerDPatch
              && pc >= TosAddress && pc <= TosAddress + TosSize)
      {
         /* Slow down Timer-D if set from TOS for the first time to gain
          * more desktop performance.
          * Obviously, we need to emulate all timers correctly but TOS sets
          * up Timer-D at a very high rate (every couple of instructions).
          * The interrupt isn't enabled but the emulator still needs to
          * process the interrupt table and this HALVES our frame rate!!!
          * Some games actually reference this timer but don't set it up
          * (eg Paradroid, Speedball I) so we simply intercept the Timer-D
          * setup code in TOS and fix the numbers with more 'laid-back'
          * values. This still keeps 100% compatibility */
         if ( new_tcdcr & 0x07 )         /* apply patch only if timer D is being started */
         {
            new_tcdcr = IoMem[0xfffa1d] = (IoMem[0xfffa1d] & 0xf0) | 7;
            bAppliedTimerDPatch = true;
         }
      }


Notes:
- in next version of Steem this works in STF mode for Audio Artistic Demo, not STE, oddly.
Edit: it's in fact the memory, 1MB fine, 2MB doesn't work... funny :)
- in Hatari 1.7.0 ST Magazine STE Demo doesn't seem to load ? (I wanted to compare because "patch timer D" isn't a real fix and in Hatari Audio Artistic Demo also works without the patch).


Edit: OT, I noticed strange additions of the clipboard at the end of the post in this forum, quite often I need to edit to remove it, this time we had the copy/pasted hatari code coming right after "patch)."
This seems to happen when you use preview?
Last edited by Steven Seagal on Fri Oct 11, 2013 7:44 pm, edited 1 time in total.
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2506
Joined: Thu Dec 15, 2005 2:15 am
Location: France

Re: Stealing Hatari code

Postby Maartau » Fri Oct 11, 2013 4:29 pm

Cyprian wrote:It seems that we lost Steem with debugger.


Steven Seagal wrote:Yes if there is a demand for it, with next version, maybe on an apart screen to avoid confusion (not everybody knows what it is).


Cyprian wrote:definitely, there is strong demand :)


Nice job & thanks for all : +1 for debugger :thumbs:
Member of :
- aTaRi LeGeNd -,
- NoExTrA -,
- eLiTe ! -

[2017-06-26] & more...

:megaphone: "Cleaning/checking my ST mess " :contract: . "Back @ my (delayed) projects" :angel: .
-> Slowed due to serious health troubles <-

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Fri Oct 11, 2013 7:48 pm

Maartau wrote:Nice job & thanks for all : +1 for debugger :thumbs:


The debugger actually is available :
http://sourceforge.net/projects/steemss ... SSE%203.5/

Steem SSE 3.5.2.Debug.Win32.zip

And very soon v3.5.3 coming up...
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2506
Joined: Thu Dec 15, 2005 2:15 am
Location: France

Re: Stealing Hatari code

Postby Maartau » Wed Oct 23, 2013 1:02 am

Steven Seagal wrote:Steem SSE 3.5.2.Debug.Win32.zip - And very soon v3.5.3 coming up...

:cheers: -> "On AF we learned that Steven Seagal rules".
Member of :
- aTaRi LeGeNd -,
- NoExTrA -,
- eLiTe ! -

[2017-06-26] & more...

:megaphone: "Cleaning/checking my ST mess " :contract: . "Back @ my (delayed) projects" :angel: .
-> Slowed due to serious health troubles <-

User avatar
Steven Seagal
Atari God
Atari God
Posts: 1688
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: Stealing Hatari code

Postby Steven Seagal » Sun Oct 05, 2014 8:50 am

I also copied the Hatari emulation of CPU instruction ABCD, this is why the ICS intro for Espana 92 didn't work in Steem:

Code: Select all

#if defined(SSE_CPU_ABCD)
/*
  http://en.wikipedia.org/wiki/Binary-coded_decimal#Addition_with_BCD
  each decimal digit is coded on 4bit

    0-9  0-9   +   0-9  0-9   
    ---- ----      ---- ---- 

  The Steem way works for normal operands but when an operand
  is illegal (nibble>9), the result isn't the same as on a MC68000,
  that uses the "+6" trick.
  http://tams-www.informatik.uni-hamburg.de/applets/hades/webdemos/20-arithmetic/10-adders/bcd-adder.html
  In the MC68000, the 'DAA' decimal adjust accumulator is integrated into ABCD.
  It is correct in Hatari, so we use the same way now.
  Fixes Espana 92 -ICS
*/
  BYTE src = m68k_src_b;
  BYTE dst = (m68k_DEST_B&0xff);
  BYTE lo_nibble=(src & 0xF) + (dst & 0xF) + ( (sr&SR_X) ? 1 : 0);
  SR_CLEAR(SR_X+SR_C+SR_N);
  if(lo_nibble>9)
    lo_nibble+=6;
  WORD hi_nibble=(src & 0xF0) + (dst & 0xF0) + (lo_nibble&0xF0);
  if(hi_nibble>0x90)
  {
    hi_nibble+=0x60;
    SR_SET(SR_X+SR_C);
  }
  m68k_DEST_B=(hi_nibble&0xF0)+(lo_nibble&0xF);
  if(!m68k_DEST_B)
    SR_SET(SR_Z)
  else if(m68k_DEST_B<0)
    SR_SET(SR_N) // not sure of that, it's so in Hatari
  break;

#else  // Steem 3.2
    int n=
       ( ((m68k_DEST_B&0xf0)>>4)*10+(m68k_DEST_B&0xf) )
      +( ((m68k_src_b&0xf0)>>4)*10+(m68k_src_b&0xf) );
    if(sr&SR_X)n++;
    SR_CLEAR(SR_X+SR_C+SR_N);
    if(n>=100)SR_SET(SR_X+SR_C); //if a carry occurs
    n%=100;
    if(n)SR_CLEAR(SR_Z);
    m68k_DEST_B=(BYTE)( (((n/10)%10)<<4)+(n%10) );
    break;
#endif
In the CIA we learned that ST ruled
Steem SSE: http://ataristeven.exxoshost.co.uk/Steem.htm

User avatar
npomarede
Atari God
Atari God
Posts: 1102
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: Stealing Hatari code

Postby npomarede » Sun Oct 05, 2014 9:28 am

Indeed, adding both nibbles at the same time and only checking >=100 for the final result is seriously broken. Luckily the BCD instructions are not used that much on ST, else many more programs would have bad results under Steem :)
Maybe there's a similar problem in NBCD and SBCD too ?


Social Media

     

Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests