6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 11:24 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Sat Feb 09, 2019 2:36 am 
Offline

Joined: Mon Nov 26, 2012 3:40 am
Posts: 42
So I'm porting EhBasic to the NES and was contemplating getting a commercial license. Sadly, since Lee has died, I was wondering how would you handle the copyright status as this is now officially an orphaned work?

If anything here's at least a screenshot of progress...
Image

I still have to write handlers for Tab, LF, and CR... Oh and the input system too.

I was thinking of making a "Basic compiler" for the NES where you could program in EhBasic and then a NES ROM image is created with the Basic acting as a kernal and your program saved in ROM. (Leaving all 8k of ram for variables) There is a stipulation for commercial licensing for EhBasic, but well, it's difficult to ask now :/

Ideas?


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 10:32 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
halkun wrote:
So I'm porting EhBasic to the NES and was contemplating getting a commercial license. Sadly, since Lee has died, I was wondering how would you handle the copyright status as this is now officially an orphaned work?

If anything here's at least a screenshot of progress...
Image

I still have to write handlers for Tab, LF, and CR... Oh and the input system too.

I was thinking of making a "Basic compiler" for the NES where you could program in EhBasic and then a NES ROM image is created with the Basic acting as a kernal and your program saved in ROM. (Leaving all 8k of ram for variables) There is a stipulation for commercial licensing for EhBasic, but well, it's difficult to ask now :/

Ideas?


If it were me, then I'd do the port, give it away for free with full sources, etc. then offer consultancy services, or sell games, utilities, etc. based on it.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 10:50 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Why do you need a commercial license? What are you planning to charge for?

I think Lee was happy for people to use his code as long as it was given away freely and others didn't claim it to be their own work.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 11:21 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Formally, copyright now belong to his heirs. Maybe they can be contacted.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 11:33 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
I really think anyone is on a sticky wicket here... If EhBASIC really is an enhanced version of MS Basic then the issue of copyright is probably moot as if MS get wind of it, then they might have something to say.

Someone - Lee's family, maybe would have to prove beyond doubt that it was an original work before I'd try to do anything commercial with it whatsoever and without full, annotated sources to go on, that's going to be somewhat challenging.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 3:28 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
drogon wrote:
I really think anyone is on a sticky wicket here... If EhBASIC really is an enhanced version of MS Basic then the issue of copyright is probably moot as if MS get wind of it, then they might have something to say.

I believe EhBasic was entirely Lee's own work.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 4:39 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
BitWise wrote:
drogon wrote:
I really think anyone is on a sticky wicket here... If EhBASIC really is an enhanced version of MS Basic then the issue of copyright is probably moot as if MS get wind of it, then they might have something to say.

I believe EhBasic was entirely Lee's own work.


I asked something along these lines a while back - the replies I got more or less indicated that it might not be all his own work.

viewtopic.php?f=5&t=5389

And if it was all his own work, then why is all we have what is effectively a disassembly. Is there a properly annotated source file anywhere?

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 8:43 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
drogon wrote:
And if it was all his own work, then why is all we have what is effectively a disassembly. Is there a properly annotated source file anywhere?

It's available at https://github.com/jefftranter/6502/blo ... source.zip . It is heavily commented.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 8:57 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
It's a bit of a lesson for anyone choosing a non-standard license for their offerings - their choice may not have all the effects they intend.

As noted, only Lee's heirs can issue a commercial license.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 9:42 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
GARTHWILSON wrote:
drogon wrote:
And if it was all his own work, then why is all we have what is effectively a disassembly. Is there a properly annotated source file anywhere?

It's available at https://github.com/jefftranter/6502/blo ... source.zip . It is heavily commented.


It is a very well commented disassembly.

I've no doubt that Lee put a lot of work into this, dissembling, commenting and Enhancing, but I'm not convinced it was all his original work.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 09, 2019 10:58 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
drogon wrote:
GARTHWILSON wrote:
drogon wrote:
And if it was all his own work, then why is all we have what is effectively a disassembly. Is there a properly annotated source file anywhere?

It's available at https://github.com/jefftranter/6502/blo ... source.zip . It is heavily commented.


It is a very well commented disassembly.

I've no doubt that Lee put a lot of work into this, dissembling, commenting and Enhancing, but I'm not convinced it was all his original work.

-Gordon


I've downloaded the first release of the code from Lee's site via the Wayback machine

https://web.archive.org/web/20030118100532/http://members.lycos.co.uk/leeedavison/6502/ehbasic/

.. and compared bits of it with the Microsoft Basic source here

https://github.com/brajeshwar/Microsoft-BASIC-for-6502-Original-Source-Code-1978/blob/master/M6502.MAC.txt

.. and there are a lot of similarities you wouldn't expect if the code was all Lee's own work.

The order of the tokens for example starts END, FOR, NEXT, DATA in both and the order for the functions starts SGN, INT, ABS, USR in both. This could explained if Lee was trying to have some degree of token code compatibility but his additions break this later in the table.

Some of the code looks very similar too. For example the code for inserting a line into a program looks like this in the Microsoft version:
Code:
BLTU:   JSR   REASON      ;ASCERTAIN THAT STRING SPACE WON'T
            ;BE OVERRUN.
   STWD   STREND
BLTUC:   SEC         ;PREPARE TO SUBTRACT.
   LDA   HIGHTR
   SBC   LOWTR      ;COMPUTE NUMBER OF THINGS TO MOVE.
   STA   INDEX      ;SAVE FOR LATER.
   TAY
   LDA   HIGHTR+1
   SBC   LOWTR+1
   TAX         ;PUT IT IN A COUNTER REGISTER.
   INX         ;SO THAT COUNTER ALGORITHM WORKS.
   TYA         ;SEE IF LOW PART OF COUNT IS ZERO.
   BEQ   DECBLT      ;YES, GO START MOVING BLOCKS.
   LDA   HIGHTR      ;NO, MUST MODIFY BASE ADDR.
   SEC
   SBC   INDEX      ;BORROW IS OFF SINCE [HIGHTR].GT.[LOWTR].
   STA   HIGHTR      ;SAVE MODIFIED BASE ADDR.
   BCS   BLT1      ;IF NO BORROW, GO SHOVE IT.
   DEC   HIGHTR+1   ;BORROW IMPLIES SUB 1 FROM HIGH ORDER.
   SEC
BLT1:   LDA   HIGHDS      ;MOD BASE OF DEST ADDR.
   SBC   INDEX
   STA   HIGHDS
   BCS   MOREN1      ;NO BORROW.
   DEC   HIGHDS+1   ;DECREMENT HIGH ORDER BYTE.
   BCC   MOREN1      ;ALWAYS SKIP.
BLTLP:   LDADY   HIGHTR      ;FETCH BYTE TO MOVE
   STADY   HIGHDS      ;MOVE IT IN, MOVE IT OUT.
MOREN1: DEY
   BNE   BLTLP
   LDADY   HIGHTR      ;MOVE LAST OF THE BLOCK.
   STADY   HIGHDS
DECBLT: DEC   HIGHTR+1
   DEC   HIGHDS+1   ;START ON NEW BLOCKS.
   DEX
   BNE   MOREN1
   RTS         ;RETURN TO CALLER.

And this is Lee's
Code:
LAB_11CF
   JSR   LAB_121F      ; check available memory, "Out of memory" error if no room
               ; addr to check is in AY (low/high)
   STA   Earryl      ; save new array mem end low byte
   STY   Earryh      ; save new array mem end high byte

; open up space in memory
; move (Ostrtl)-(Obendl) to new block ending at (Nbendl)
; don't set array end

LAB_11D6
   SEC            ; set carry for subtract
   LDA   Obendl      ; get block end low byte
   SBC   Ostrtl      ; subtract block start low byte
   TAY            ; copy MOD(block length/$100) byte to Y
   LDA   Obendh      ; get block end high byte
   SBC   Ostrth      ; subtract block start high byte
   TAX            ; copy block length high byte to X
   INX            ; +1 to allow for count=0 exit
   TYA            ; copy block length low byte to A
   BEQ   LAB_120A      ; branch if length low byte=0

               ; block is (X-1)*256+Y bytes, do the Y bytes first

   SEC            ; set carry for add + 1, two's complement
   EOR   #$FF         ; invert low byte for subtract
   ADC   Obendl      ; add block end low byte

   STA   Obendl      ; save corrected old block end low byte
   BCS   LAB_11F3      ; branch if no underflow

   DEC   Obendh      ; else decrement block end high byte
   SEC            ; set carry for add + 1, two's complement
LAB_11F3
   TYA            ; get MOD(block length/$100) byte
   EOR   #$FF         ; invert low byte for subtract
   ADC   Nbendl      ; add destination end low byte
   STA   Nbendl      ; save modified new block end low byte
   BCS   LAB_1203      ; branch if no underflow

   DEC   Nbendh      ; else decrement block end high byte
   BCC   LAB_1203      ; branch always

LAB_11FF
   LDA   (Obendl),Y      ; get byte from source
   STA   (Nbendl),Y      ; copy byte to destination
LAB_1203
   DEY            ; decrement index
   BNE   LAB_11FF      ; loop until Y=0

               ; now do Y=0 indexed byte
   LDA   (Obendl),Y      ; get byte from source
   STA   (Nbendl),Y      ; save byte to destination
LAB_120A
   DEC   Obendh      ; decrement source pointer high byte
   DEC   Nbendh      ; decrement destination pointer high byte
   DEX            ; decrement block count
   BNE   LAB_1203      ; loop until count = $0

   RTS            ;

Different labels but its basically the same.

It does appear that Lee disassembled Microsoft Basic and reused portions of it to build EhBasic.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 10, 2019 7:43 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
A consequence of this sort of derived work is that the copyright rests with two parties: Microsoft have copyright on their contributions, and Lee's estate has copyright on his. According to law, you'd need agreement from both parties before distributing or modifying the result.

(Of course, in practice, these days people ignore Microsoft's claims on their 8-bit Basics, and Microsoft ignore them too. By no means does this neglect change the status of the code or the claim.)


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 10, 2019 5:29 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
The BASIC here seems to have the same problem. It comes with a 2-clause BSD license but is clearly derived from disassembled ROMs of various 6502 computers. It even assembles to exactly the same addresses for the individual machine's ROM.

If I were to produce a comercial product to include BASIC, I would start from scratch and would include the features of a modern BASIC: No line numbers but labels, structured programming (If-THEN-ELSE, loops, function/procedure calls with local variables) and the requirement to declare all varables in advance getting rid of the need to search in RAM for every reference to a variable and the dreadfull garbadge collection.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Sun Feb 10, 2019 6:17 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Klaus2m5 wrote:
If I were to produce a comercial product to include BASIC, I would start from scratch and would include the features of a modern BASIC: No line numbers but labels, structured programming (If-THEN-ELSE, loops, function/procedure calls with local variables) and the requirement to declare all varables in advance getting rid of the need to search in RAM for every reference to a variable and the dreadfull garbadge collection.


You've just described a compiled language ;-)

I did write a BASIC interpreter a few years ago, however I wrote it in C with not real thoughts on making it work on anything other than a 32-bit micro (running Linux, but that's not essential). It's almost as you describe above, however you don't need to pre-declare variables (but it is an error to read from an un-initialised scalar variable). It works almost as a one-pass compiler maintaining a separate symbol table for variables, although strings an arrays are dynamically allocated at run-time. The tokenised code is effectively interpreted in much the same way most tokenising BASICs work. It supports named & recursive procedures and local variables.

An example is here: https://unicorn.drogon.net/wumpus.rtb

I have been thinking of an 8 (or 16) bit re-write of it, but not sure I have the time or energy right now, although maybe this summer when I've cleared some other projects I have going. If I released it, it would be GPLv3 which I've used before. (although that's not stopped people stealing my code and passing it off as their own - if only I had the resources to pursue them, but such is life...)

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 13, 2019 1:26 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
If you want to build a product using EhBASIC then do so. Just don't directly include the interpreter. You could provide a 'free' ROM pre-programmed with the code as a bonus for buying the product such that the end user must plug the free ROM in to use it. This would be allowed under Lee's license wording.

You could also do what Lee did and just modify the code and call it your own.

_________________
Bill


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: