6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 12:08 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Dec 11, 2016 4:00 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Every 8 bit platform needs a Forth interpreter. As I've ported TaliForth to the SBC 2 platform, I figured I could port it to an Apple 1 compatible without much work. The updated sources and build files are here:

https://github.com/Martin-H1/TaliForth

The build file depends upon a conversion tool which converts the binary into a Woz Mon script. The source is here:

https://github.com/Martin-H1/BinToMon

Rather than force everyone to fetch and build my conversion tool, I also checked in the Woz Mon script:

https://github.com/Martin-H1/TaliForth/ ... l-star.txt

Upload using a terminal program and you are off to the Forth races.

I compiled Tali Forth to assume 32K or RAM which might not be available on a real Apple 1 or more faithful clone. I also found a Apple 1 Hex file of VolksForth which I was also able to convert to a Woz Mon script. It starts at address 1000, so it would work on a more compact RAM arrangement. Although there's sources in the Zip file, they require an Atari ST to build! As I am fresh out of Atari ST's, all I just checked the Woz Mon script into my Git repo for safe keeping:

https://github.com/Martin-H1/TaliForth/ ... sforth.txt


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 12, 2016 2:23 am 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
Martin_H wrote:
Rather than force everyone to fetch and build my conversion tool, I also checked in the Woz Mon script:

https://github.com/Martin-H1/TaliForth/ ... l-star.txt


Cool! Thanks for posting!

You should post the binary file too; by incorporating it into the firmware you can make it show up instantly as either ROM or pre-initialized RAM. To accomplish that, put the binary image file into the same directory as the Appl1SRAM project, e.g. as tali-l-star_5A00.bin (5A00 in the name is just a reminder where it expects to be loaded). Then use the Propeller tool to edit Apple1.spin as follows:
  1. Below the line that starts with "rom: "Memory" ", add a new line that reads:
    Code:
    tali: "Memory"
  2. Below the line that starts with "rom.StartEx", add a new line that reads:
    Code:
    tali.StartEx(@TaliFile, @TaliEnd, @TaliEnd, $5A00, 0)
    If you want to emulate the image as pre-initialized RAM instead of ROM, use "@TaliFile, @TaliFile, @TaliEnd" as the first three parameters (the second parameter changes to @TaliFile).
  3. Below the line that starts with "RomEnd", add the following three lines:
    Code:
    TaliFile
            File "tali-l-star_5A00.bin"
    TaliEnd

Now right-click on the Apple1.spin window title and click "Top Object File". Then hit Ctrl+F11 while the computer is connected to the L-Star. This will compile the program and store it in the EEPROM.

From now on, your L-Star has Forth as soon as you start. All you need to do is (presumably) enter "5A00R" in Woz mon.

You could even change the reset vector so it starts Forth whenever you reset the 6502:
  1. Insert the following above the DAT section in the Apple1.spin module:
    Code:
    PRI Patch(addrval, dataval)

      byte[addrval + @RomEnd - $1_0000] := dataval
  2. Insert the following lines above the line that starts with "clock.activate...":
    Code:
      Patch($FFFC, $00);
      Patch($FFFD, $5A);

NOTE: as of this writing, I haven't tried it myself but I intend to do so; I'm pretty sure it will work. I'll probably add the result as a new project in my Github repo (suggestions for a project name are welcome :) ). I think I'll also play around with adding a video generator that gives the 6502 direct access to the screen (like the OSI emulator, but with a slightly less wonky memory layout -- the OSI video hardware kept counting addresses even during blanking which makes the memory layout weird).

===Jac


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 12, 2016 4:59 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Great, that will help a bunch.

I'll definitely check in the binary as well.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 23, 2024 1:14 am 
Offline

Joined: Tue Apr 23, 2024 1:10 am
Posts: 4
Looks like this is built for the 65C02, so it won't run on a true emulation of an Apple-1 (or real Apple-1), which uses the original 6502. Any chance you could produce a build for regular 6502?

(I realize this reply is about a decade late.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 25, 2024 4:17 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
TaliForth 1.0 is a dead Forth as TaliForth 2.0 is a complete redesign. So I stopped using it a while back and removing the C02 dependencies isn't worth it.

Does VolksForth need a C02 as well?

Probably the best strategy is getting FigForth running which is also in my repo as well.

https://github.com/Martin-H1/6502/tree/master/FigForth


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 28, 2024 11:41 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 145
Location: Lake Tahoe
Here is my Apple 1 figForth based off John Mathews ProDOS version. It requires the CFFA1 for the additional 32k RAM and screen storage: http://schmenk.is-a-geek.com/Forth.html


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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: