Jump to content
IGNORED

Lynx Programming Environment Setup Routine


OldAtAtari

Recommended Posts

I've been learning to program for the Lynx for a couple weeks now, and the most difficult part has been the environment setup. My setup has been evolving, with several missteps and problems, along with some outdated files, but I think I've finally gotten it in a good place. So I'm writing down the routine here for anyone who wants to take this approach. This procedure is current and working as of January 11, 2023.

Note 1: These instructions can lead you in setting up a Linux machine (starting in step 4) or a Windows/Linux hybrid (starting in step 1). The setup I'm using is the Windows/Linux hybrid. Essentially, it's an Ubuntu Linux terminal window that you can use from within Windows 10. So I can have a Linux terminal window right beside my Windows tools, which in some cases seem to be better than their Linux counterparts. Steps 1 and 2 of these instructions detail how to set that up. If you want to run this on a Linux machine instead of a Windows machine, you can skip to step 3.

 

Note 2: This setup is based around karri's template (Nop90's version), and is appropriate for programming in C and also in assembly. 

 

Note 3: I'm no expert. Hopefully the experts here in the forum will chime in with corrections and additions.

 

The Instructions

 

If you want to run a Hybrid Windows/Linux setup, start at step 1. If you're on an actual Linux machine, skip to step 4:

 

1) Enable Linux in Windows 10, and install the Linux application (Ubuntu 18.04 LTS is used in these setup instructions). Follow the instructions at the following link:

https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

 

2) In the Ubuntu terminal, enter the following line:

sudo apt update

 

3) When you do the Windows/Linux hybrid setup, it creates a folder way deep down in your Windows directory system. This is where it stores all the files in your Linux area. If you try to edit any of these files with the Windows tools, it will cause problems with your Linux setup. So what we need to do is create a Windows directory specifically for the Linux files you want to have Windows edit access to. So on my Windows desktop, I created a directory called LinuxHome. Then, when I'm in an Ubuntu terminal, I can access this directory at the following Linux path:

/mnt/c/users/Steven/Desktop/LinuxHome/

but that's a lot to type in each time I need to access it, so I created a link in my Linux terminal window for easy access:

ln -s /mnt/c/users/Steven/Desktop/LinuxHome/ win

Now, whenever I want to access my Windows directory from Linux, at the Linux command prompt, I just have to type:

cd ~/win

It acts like a Windows directory and like a Linux directory. I can run Linux programs in that directory from a Linux terminal, and I can run Windows programs in that directory from the Windows. Most importantly, it means that I can use Windows editing tools (graphic editors and text editors) on my game files, and then I can go to my Linux terminal and have those files there, too. Sometimes, I'll use notepad++ to edit a text file in Windows if I'm making big changes to it, and then if I just want to make some simple tweaks, I'll edit that same file in vi at the Linux command line.

 

*** All the following steps need to be done whether you're setting the environment up on a Windows machine or a Linux machine ***

 

4) In a Linux terminal (or in your Windows Ubuntu window from steps 1, 2, and 3), at your home directory, enter the following lines:

mkdir Atari
cd Atari
sudo apt-get install git checkinstall mednafen
git clone https://bitbucket.org/atarilynx/lynx.git
cd lynx/tools
make -f Makefile.deb

    - This "make" command might ask for your password a time or two, and it might pause a time or two. Be patient with it.

 

5) Download the Atari Lynx program template:

In your ~Atari directory, enter the following:

git clone https://github.com/oldatatari/template/

 

6) Do a make in the template directory:

cd ~/Atari/template/
make

 

7) If you plan to work only in C, then you're done.

Your directory tree should look something like this:
/home/username
    -->Atari
        -->lynx
            -->tools
                -->bll
                -->cc65
                -->lynxer
                -->lyxass
                -->newcc65
        -->template
            -->cart
            -->game
            -->intro
            -->resident
            -->tunes

 

8 ) If you plan to work in assembly, you'll need to download updated versions of a couple of the tools. I chose to put these in a separate subdirectory from the template and other tools, so that it will be easier to update things independently later on. 

cd ~/Atari
mkdir lynx_updated
cd lynx_updated
git clone https://github.com/42Bastian/new_bll.git
git clone https://github.com/42Bastian/lyxass.git

 

 

9) Do a make in the updated lyxass directory

cd ~/Atari/lynx_updated/lyxass
make

 

10) And also if you plan to work in assembly, you'll need to set your BLL_ROOT environment variable and declare the path to the updated lyxass directory. In ~/.bashrc, add the following lines to the end and save the file:

export BLL_ROOT=$HOME/Atari/lynx_updated/new_bll
export PATH="$HOME/Atari/lynx_updated/lyxass:$PATH"

 

11) Do a source on your ~/.bashrc to update your environment

source ~/.bashrc

 

12) You should now be set up to work in both C and assembly.

Your directory tree should look something like this:
/home/username
    -->Atari
        -->lynx
            -->tools
                -->bll
                -->cc65
                -->lynxer
                -->lyxass
                -->newcc65
        -->template
            -->cart
            -->game
            -->intro
            -->resident
            -->tunes
        -->lynx_updated
            -->lyxass
            -->new_bll

 

Edited by OldAtAtari
Changed from nop90 template to OldAtAtari template (updated and working as of January 11, 2023)
  • Like 4
Link to comment
Share on other sites

6 hours ago, 42bs said:

I recommend also to update PATH to point to the respective folder where the executables are.

Thanks, 42bs. I want to make sure I have a correct understanding before updating the instructions.

 

So what would you add to PATH?

 

In my case, would it be:

 

~/Atari/lynx/tools

and

~/Atari/lynx_updated

 

Is that right? Or does each tool need it's own specific path, such as:

 

~/Atari/lynx_updated/lyxass

and

~/Atari/lynx/tools/cc65/src/cc65

 

But I notice that "lyxass" and "cc65" at the command line already produce output, so I wonder if those paths were put in place when I ran the MakeFiles during installation.

 

 

 

 

Link to comment
Share on other sites

The Makefile.deb creates a few targets. Perhaps I should delete these lines. There is no point in using these old versions as they were never updated in my source tree.
        $(MAKEIFMISSING) cc65
        $(MAKEIFMISSING) lyxass
        $(MAKEIFMISSING) bll

 

I just pushed these changes to the repo.

 

You can delete these manually with 

sudo dpkg -r lyxass bll

  • Like 1
Link to comment
Share on other sites

41 minutes ago, karri said:

The Makefile.deb creates a few targets. Perhaps I should delete these lines. There is no point in using these old versions as they were never updated in my source tree.
        $(MAKEIFMISSING) cc65
        $(MAKEIFMISSING) lyxass
        $(MAKEIFMISSING) bll

 

I just pushed these changes to the repo.

 

You can delete these manually with 

sudo dpkg -r lyxass bll

Thanks, karri. That's good news. 

Link to comment
Share on other sites

4 hours ago, 42bs said:

The PATH should point to the exe.
Try which lyxass to the get the path from where (here) lyxass is fetched.

 

So if cc65 and lyxass can be found, these might be at some other place then the one you build the tools.

Ok, so I've added this to the instructions in step 9 to be added into ~/.bashrc:

export PATH="$HOME/Atari/lynx_updated/lyxass:$PATH"

 

That works for me, but is it what you were thinking?


And are there any other executables I need to declare? It seems like karri's script is taking care of all the executables in the /lynx/tools/cc65 directory.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...