Jump to content
Sign in to follow this  
SpiceWare

Coming soon!

Recommended Posts

I'll be adding instructions on how to set up a Linux environment for building Atari VCS/2600 programs that take advantage of the ARM assisted bankswitching schemes DPC+, BUS, and CDFJ.  Over the next few months I'll add example programs showing how to code for each bankswitching scheme.  After that I plan to resume work on SpiceC as part of this club.

 

Do note that BUS is not stable across all Atari 2600 models, so programs using it will not be made available for sale via the AtariAge store as supporting those would be a major hassle.  

  • Like 6

Share this post


Link to post
Share on other sites

So my plan is to basically redo the DPC+ ARM blog entries* from Feb 4 - May 3, 2015. As part of redoing them I'll update them with what we've figured out since then, like the newer build scripts I worked up for SpiceC that automatically pass the variables from DASM to the C code.  As I update each DPC+ blog entry for the Harmony/Melody Club I'll also make BUS and CDFJ versions of them.  And, of course, I plan to finish the tutorial this time.  

 

The first five of those entries goes over setting up the Linux Virtual Machine, which is what I worked on last night.  I ran into all sorts of problems with the Ubuntu 18.04 LTS (the current Long Term Support version). Namely it's sluggish beyond belief, so much so that I aborted the install a few times thinking it had locked up. After finally getting it installed I discovered HiDPI support within the VM is now horrible - I run on a 4K display so I like to set Ubuntu to use 200% scaling, which makes things legible with crisp text and icons.  Problem is the way it's now integrated with VirtualBox - if you shrink the window running Ubuntu beyond a certain point it decides to turn off the scaling, which makes everything very tiny and difficult to read. On top of that, it disables the scaling option so you can't even override it (the option is only enabled if the window is "large enough").  In my normal usage I'd shrink the window to be the same size as the Terminal as that's pretty much what I use the VM for.

 

I did like the option for a minimal install though, no need to waste disk space installing the office suite and other such programs when we'd be running those under our real machine.

 

I also tried Lubuntu 18.04 LTS, which is a lightweight version of Ubuntu.  It did not have the problem with sluggishness, and did have a minimal install option. Didn't see any scaling option for HiDPI support - I was able to use VirtualBox's scaling feature to get around that, though it results in fuzzy looking text and icons.

 

I did not try the newer Ubuntu 19.04 as it's only supported until January 2020 (ie: it is not an LTS version).  

 

At this point my plan is to do some research on Lubuntu 18.04 to see if there's a way to use HiDPI.  If not then I'll most like revert to the 16.04 LTS I used before as it's still supported thru April 2021.

 

 

* sadly the categories are gone.  If you go to my blog you'll currently find the entries on pages 6 and 7.

 

  • Like 1

Share this post


Link to post
Share on other sites

I tried installing a few different types of 32 bit linux using VirtualBox about a month ago but couldn't get anything to work. From what I read it might be a problem with my graphic drivers. I tried several things to make it work, but none were sucessful.

 

I'm interested in if you can use the 64 bit builds now and not have problems with compiling code for the ARM. If that will work I will try a newer version of linux, and worst case buy a different PC (which I need).

Share this post


Link to post
Share on other sites
On 6/26/2019 at 9:59 PM, Omegamatrix said:

I'm interested in if you can use the 64 bit builds now and not have problems with compiling code for the ARM. If that will work I will try a newer version of linux, and worst case buy a different PC (which I need).

 

Yes, the laptop I used to finish Draconian (as we made our way cross country to PRGE) is running 64-bit Ubuntu.  I really need to copy the final source from it to my Mac. (turned out I'd already done this).

 

508315867_Screenshotfrom2019-06-2622-56-25.thumb.png.94d4a301910ab13098e3131bcae04999.png

 

Share this post


Link to post
Share on other sites

I've decided to go with Lubuntu 18.04 and have successfully installed the compilers and built Draconian.

Did run into a problem though - something's changed with GCC and/or the ARM compiler Linaro.  In the header file a number of inline functions are defined, such as this one:

inline void setPointer(int fetcher, unsigned int offset) {
  QPTR[fetcher] = offset << 20;
}

 

which caused a compile error:

main.c:(.text.GameVerticalBlank+0xde): undefined reference to `setPointer'

 

I found this page about GCC inline and tried this:

__inline__ void setPointer(int fetcher, unsigned int offset) {
  QPTR[fetcher] = offset << 20;
}

 

which failed with the same error.  I then tried this:

static inline void setPointer(int fetcher, unsigned int offset) {
  QPTR[fetcher] = offset << 20;
}

 

Which got past that error.  Strangely enough other functions in the header still worked OK without adding static, so I'm not sure what to think about that.

 

inline void setIncrement(int fetcher, unsigned char whole, unsigned char frac) {
  QINC[fetcher] = ((whole << 8) | frac);
}
inline void setSamplePtr(unsigned int address) {
  WAVEFORM[0] = address;
}


One last remaining issue occurred when DASM merged everything together:

dasm draconian.asm -f3 -odraconian.bin -ldraconian.lst -sdraconian.sym
segment: CODE 689e                    vs current org: 68da
 ---- RIOT RAM $79 bytes free
 ---- Display Data Menu  $740 bytes free
 ---- Display Data Game  $1e bytes free
 ---- CDF DRIVER SIZE $800 bytes
 ---- C CODE SIZE $468c bytes
 ---- samples use  4659
 ---- -60 bytes free for ARM Code, samples, & graphics

stationary_data.asm (16): error: Origin Reverse-indexed.

 

Basically the C code compiled to a larger size than before, which caused the ROM to be short of space to the tune of 60 bytes. As a quick workaround I commented out the "ALERT! ALERT!" sample.


I've documented the steps I took to set up the virtual machine.  I'll be redoing them this weekend while taking lots of screenshots, so I can work up some instructions similar to before.  Then I'll work up a small test program that'll be used to make sure your virtual machine is set up correctly.

I'm also thinking about zipping up the virtual machine and putting it on my site for you to download. I believe all you'd need to do is map the shared directory for your source code, which resides on your real machine.  One thing I'm not sure about with the shared folder is if it'll cause problems with Windows due to its use of a different end-of-line character - Mac and Linux both use the same one.

Share this post


Link to post
Share on other sites

I zipped up my test virtual machine folder and put it on a USB stick so I could try setting it up on my laptop which has 2 internal drives.  One drive's running Ubuntu 16.04, the other Windows 10.

 

I installed VirtualBox on both and was able to set it up on Ubuntu without any problems:

81961814_Screenshotfrom2019-06-3010-15-57.thumb.png.dd3c169a8c0b8197a02ecc2c24251c67.png

 

 

Windows, on the other hand, would not unzip the file:

438318690_cannotunzip.png.204af7f36064108730b9571ed8a4080f.png

 

I think the problem is Window's believes the file test.vdi is 1.68 GB, it's actually 9.68 GB. That tells me windows is using a 32-bit value for the size, when it needs to use a 64-bit value.  I was able to get around that by installing 7-Zip, though the unzip process took longer than expected. Seemed to run just fine on Windows after that:

 

2094312634_successfulcompile.thumb.png.de7553652c2e69586518c65679a1e157.png

 

I do have one last thing to resolve, note the message at the bottom of each terminal.  I get the same in the Virtual Machine on my Mac as well:

make: warning:  Clock skew detected.  Your build may be incomplete.

This does not occur with my Ubuntu 16.04 Virtual Machine.  

 

After that I'll follow my steps to create a new Virtual Machine (not called test), while taking screenshots to document the steps.  I'll post how to do it, but will also zip it up and put it on my website so y'all don't have to manually install it if you don't wish to.

 

 

 

Share this post


Link to post
Share on other sites

Sorry guys, won't be able to get back to this until next month. We had a medical scare with dad. He's out of the hospital and doing much better, though tests are still ongoing to diagnose and fix the problem.

 

And, as mentioned during Stella-thon, I'll be heading to Wisconsin soon for a wedding. My cousin and her fiancé have a streaming channel on Twitch and have only gone back as far as the NES, so I'm currently setting them up a RetroN 77 as part of the wedding gift. My nephew and I will be representing the Texas branch of the family, and I'll be covering our road trip in Tesla Club if you're interested in seeing how a ~3000 mile round trip works out in a Model 3.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...