-
Content Count
16,912 -
Joined
-
Last visited
-
Days Won
10
Content Type
Profiles
Member Map
Forums
Blogs
Gallery
Calendar
Store
Everything posted by SpiceWare
-
NOTE: I want to clarify up front that this is an advanced Atari 2600 programming series. As such, I will not be covering basic things like triggering a Vertical Sync, what a Kernel is, why you need to set a timer for Vertical Blank, etc. If you need to learn that you should check out with the following: Collect - detailed development of a 2K game 2600 Programming for Newbies - use the Sorted Table of Contents topic that's pinned at the top in order to easily access the tutorial topics in order. CDFJ Tutorial Index Part 1 - CDFJ Overview Initial overview of CDFJ Part 2 - CDFJ Details Registers, Datastreams, etc. Part 3 - Beginnings of Collect 3 Framework for Collect 3 Part 4 - CDFJ Debugging with Stella A look at Stella's Debugger Part 5 - Source Improvements Minor revisions to the project Part 6 - Console Detection 2600 or 7800? NTSC, PAL, or SECAM? Part 7 - Menu Added menu, C data in 6507 source Part 8 - Score & Timer Added score kernel with some diagnostics Part 9 - Arena Added arena, utilizes incremental data streams and fast jump Part 10 - Sprite Multiplexing, coming soon NOTE: Check out Start Here in the General forum for instructions on how to set up an environment for CDFJ development.
-
Let's start out with an overview of CDFJ. Part 2 will go into more detail. The Harmony/Melody contains 32K of ROM and 8K of RAM. Breakdown of its usage for CDFJ is: CDFJ Driver The CDFJ1 Driver is the ARM code that the Harmony/Melody runs in order to emulate a CDFJ coprocessor. The 6507 in the Atari has no access to the driver. Likewise the ARM has no access to the internals of the Atari. While the driver is located in ROM, it is copied into RAM when the Harmony/Melody first powers up. This is because the code runs faster when located in RAM and the extra speed is required in order for the coprocessor emulation to keep up with the Atari. C code & data Unlike DPC+, CDFJ has a dedicated section in the ROM for the compiled C code and its data. It's only 2K though, so you will most likely use Banks 0+ for your C code. Typical usage for CDFJ projects so far has been: Banks 0-5 for C code Bank 6 for 6507 code - OR - Banks 0-4 for C code Banks 5-6 for 6507 code Bank 0 If compiled C code is greater than 2K, it will expand into bank 0. If this occurs it is not recommended to also use bank 0 for 6507 code. Same recommendation goes for the following banks. The 6507 can select bank 0 by accessing memory location $FFF52. Bank 1 If custom ARM code is greater than 6K, it will expand into bank 1. The 6507 can select bank 1 by accessing memory location $FFF62. Bank 2 If custom ARM code is greater than 10K, it will expand into bank 2. The 6507 can select bank 2 by accessing memory location $FFF72. Bank 3 If custom ARM code is greater than 14K, it will expand into bank 3. The 6507 can select bank 3 by accessing memory location $FFF82. Bank 4 If custom ARM code is greater than 18K, it will expand into bank 4. The 6507 can select bank 4 by accessing memory location $FFF92. Bank 5 If custom ARM code is greater than 22K, it will expand into bank 5. If your 6507 code is greater than 4K you should use banks 5 & 6 for 6507 code. So far all of my CDFJ games have only had 4K of 6507 code, though I know John's Wizard of Wor has 8K. The 6507 can select bank 5 by accessing memory location $FFFA2. Bank 6 Bank 6 is used for 6507 code. When a CDFJ cartridge is powered up bank 6 will already be selected. If you've selected another bank then access $FFFB2 to reselect bank 6. Display Data When the Harmony/Melody is first powered on the 4K of RAM holding Display Data is not initialized, so it's up to your code to do so. This was done to keep the CDFJ driver 2K in size. While the Atari cannot "bank in" the Display Data, it can read its contents using Data Streams3. This is how the custom C code will pass information to the 6507. The Atari can also write to Display Data by using a Data Stream. This is how the 6507 code will pass information, such as the current state of the joysticks and console switches, to the custom C code. C Variables & Stack 2K of RAM is dedicated for use by C variables and its Stack. Depending upon your project this may not be enough, so we will go over how to allocate part of Display Data into the C Variables and Stack. ARM The ARM CPU used in the Harmony/Melody is the ARM7TDMI-S LPC2103. It's specs are: 32 bit CPU 70 MHz 32 KB Flash (the "ROM") 8 KB SRAM (the "RAM") Further Reading cd-w posted a few blog entries back in 2009 and 2010: Perfect Harmony Harmony Memory More Harmony They go over how the Harmony/Melody emulate a cartridge (including bankswitching support), the speed differences between SRAM vs Flash, and many other interesting bits of information. Go check them out, you'll be glad you did! 1 CDFJ stands for Chris (@cd-w) Darrell (@SpiceWare) Fred (@batari) and John (@johnnywc), who were involved in its creation. 2 due to the 6507's 8K addressing space, these locations are mirrored multiple times in memory. The mirrors are $1FFx, $3FFx, $5FFx, $7FFx, $9FFx, $BFFx and $DFFx. Any of the mirror addresses may be used. I think of them being located at $FFF5-FFFB due them being right before the RESET and IRQ vectors. The 6507 is a reduced package version of the 6502, which I first learned to program in the early 80s on my Vic 20. On a 6502 these vectors are, by definition, located at addresses $FFFC-FFFD and $FFFE-FFFF. 3 Data Streams will be covered in Part 2
-
We'll be using Linaro to compile the C code for our programs. Start up your virtual machine if it's not already running. Download Linaro Click on K-Gear Click on Firefox Web Browser Visit https://www.linaro.org The page will look different depending upon the width of the browser's window, so you'll either see a hamburger button: or a horizontal menu: So your next step is either: Click Hamburger Button Click Developer Resources Click Downloads or: Click Developer Resources Click Downloads At this time that would land you on https://www.linaro.org/downloads/ The Harmony Cart/Melody Board uses an ARM7TDMI-S LPC2103 so we need to locate the compiler for it. Scroll down to section Latest Bare-Metal Targeted Binary Toolchain Releases Locate the row containing Armv7 Click on Binaries That currently takes you to https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-eabi/ Locate the gcc-linaro-???-x86_64_arm-eabi.tar.xz file where ??? is the most current release. At time of this post that's 7.4.1-2019.02, so: Click on gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi.tar.xz Click Save File Click OK Download indictor will show up when a download is started It'll turn blue once the download is complete. Extract Linaro Click the download indictor Click the Folder icon Right-Click on the file you just downloaded Drill down to Extract->Extract archive to... This is larger than the dasm archive, so there will be a long wait while Ark processes the archive - most of the window will be ghosted: until it's finished: Click Home Double-Click 2600tools Click Extract A spinning 1 will show up in the task bar, click it to see extracting progress Update .profile Your path needs to be updated so Konsole can find dasm. Same steps as for dasm, so no screenshots. double-click Home folder on desktop Double-Click .profile to open it in Kate* Scroll to the the end of the file Copy/Paste the following at the end # set PATH so it includes linaro's bin if it exists if [ -d "$HOME/2600tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi/bin" ] ; then PATH="$HOME/2600tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi/bin:$PATH" fi Save your changes quit Kate You must log out then back in for changes in .profile to take effect. Do so now. Test Linaro At this time you should be able to use Linaro to compile the C code. We'll test it using an early version of Collect2, though the makefile has been modified to use Linaro rather than Sourcery G++ Lite (which we were using back in 2015). Download it on your Host OS, not your VM, and put it in your shared project folder. Collect2.zip Start up Konsole then change directory to your shared project folder. Click K-Gear Click Konsole type cd /media/sf<TAB> type unzip Collect2.zip Compile the C code type cd Collect2/custom type make Build the Bin type cd .. type or copy/paste dasm collect2.asm -f3 -v0 -scollect2.sym -lcollect2.lst -ocollect2.bin Use Stella on your Host machine to run Collect2 * You should still be able to see hidden files from the steps in Install dasm, but if for some reason you can't: Click Control menu Click Hidden Files menu option
-
I'm unable to use my Krok Cart as I can't find a driver for my old USB to Serial adapter. Which adapter are you using? There is a newer utility, Krokodile Command for Unix, that runs on a Mac. Source for it is here though I don't see a makefile or XCode project for it, nor do I see a prebuilt version. Maybe with @stephena can help with that. In the meantime I've zipped the version in my Applications directory, maybe that'll work for you: KrokCom.app.zip
-
Will definitely take you up on that. Not sure when that'll be, but most likely next time I next attend PRGE as we make it a 2 week road trip with sightseeing on the way there and back - we did the Grand Canyon and Napa Valley in 2017. We're thinking Yellowstone and the Tesla Factory Tour in Fremont for the next time.
-
We'll be using dasm to assemble the 6507 code for our programs. Start up your virtual machine if it's not already running. Download dasm Click on K-Gear Click on Firefox Web Browser Visit https://dasm-assembler.github.io Locate and download the Compressed 64-bit executable for Linux, at the time of this post that's dasm-2.20.11-linux-x64.tar.gz Click on Save File then OK Quite Firefox once the download is complete. Extract dasm On your VM's desktop is a Home folder, double click it, then double click the Downloads folder. Right-Click on the dasm file you downloaded Select Extract Select Extract To The Extract dialog box will be displayed Click on Home (on the left, just below Places) Right-Click on a blank area in the folder list for Home (the middle white area) Select Create New Select Folder Enter the name 2600tools Click OK Click Extract Update .profile Your path needs to be updated so Konsole can find dasm. We need to edit file .profile, which is a hidden file. Click on Home Click Control Click Hidden Files You should now see a bunch of new directories and files that are lighter than the others. Scroll down to .profile Double-click .profile it to open it in Kate Scroll to the the end of the file Copy/Paste the following at the end # set PATH so it includes dasm's bin if it exists if [ -d "$HOME/2600tools/dasm-2.20.11-linux-x64" ] ; then PATH="$HOME/2600tools/dasm-2.20.11-linux-x64:$PATH" fi Save your changes quit Kate You must log out then back in for changes in .profile to take effect. Do so now. Test dasm At this time you should be able to use dasm to build an Atari program. We'll test it using Collect. Download it on your Host OS, not your VM, and put it in your shared project folder. Collect.zip Start up Konsole then change directory to your shared project folder. Click K-Gear Click Konsole type cd /media/sf<TAB> type unzip Collect.zip type cd Collect type more readme.txt Highlight the line of text below The command used to compile is click Edit menu click Copy option click Edit menu click Paste option hit <RETURN> Use Stella on your Host machine to run Collect
-
You can read up about it in this topic. I imagine test builds will be posted in it at some point.
-
Yep, new cable and I'm now getting 1080 FHD. It didn't switch by itself though, I had to hold down ALT and click on Scaled to access extra options. I did try the ALT trick before getting the new cable, but the display went black so the old cable couldn't handle it. I had to remote in from my Mac Pro to reset it back to 30 Hz for the image to return. I also did some research on 4K Blu-ray players and decided to get a Sony UBP-X700, which by chance was on sale at Best Buy. Picture looks phenomenal. Also hooked the PS3 back up. Discovered one of my HDHomeRun tuners died, so I'm down to being able to record 4 shows at once.
-
Decided it wouldn't make sense to spend a lot of time moving and reconnecting the old receiver to find out it wouldn't work. Was able to get the optical cable to reach by scooting the rack over. It worked!
-
TVs in place, will take a while to get everything else set up so for now I'm using the built in speakers. Netflix looks awesome as does Amazon Prime Mac mini's outputting 4K with 30 bit color, but at 30 Hz for some reason. Trackpad's pretty laggy too. Wonder if I need a newer HDMI cable.
-
Made some progress during my lunch break. I still need to vacuum behind it, I used some carpet cleaner this morning and it's still a tad damp. Next step is the top glass shelf then tighten all the bolts, steps up until now have been hand-tight.
-
The parts arrived Tuesday. The vinyl wrap was a bust, didn't work well on the wood. And I didn't even get around to trying it on the curved pieces, which I suspect would be a hassle. So I picked up some Krylon and painted them yesterday. I let them sit overnight and will put the stand together this evening.
-
$73 for May, was $130 last year (solar only active for half this billing cycle) $35 for June, was $180 last year $60 for July, was $235 last year $10 for August, was $302 last year (was out of town 10 days with AC set to 90°F) $53 for September, was $297 last year $42 for October, was $235 last year
-
What assemblers are being used these days for 2600 dev?
SpiceWare replied to SmileyDude's topic in Atari 2600 Programming
Dasm and Linaro -
What assemblers are being used these days for 2600 dev?
SpiceWare replied to SmileyDude's topic in Atari 2600 Programming
Still using dasm. It has a new home. -
The blog entries got a bit mangled from the AtariAge Forum Upgrade. I've finally gone thru and fixed each blog post for the Collect tutorial. While doing so I added a new COLLECT TUTORIAL NAVIGATION feature at the bottom-right of each blog entry. Big thanks to @Random Terrain as his version of the tutorial proved invaluable in fixing the blog entries.
-
lookinh for some advice on writing for the ATARI 2600
SpiceWare replied to gorf68's topic in Atari 2600 Programming
https://harmony.atariage.com/Site/Harmony.html I've also written a tutorial that you may find helpful. -
TV Stand arrived, box was beat up during shipment. All the parts inside were OK, including the glass shelves, but a couple parts fell out in transit. I've already contacted Z-Line who said they'd have the replacements shipped within 48 hours, and that it'd be 4 days for shipping after that. So I've delayed the TV's delivery from Monday to Friday.
-
Yep - EyeTV stores all recordings in a single directory. Each is stored as a package with a name in the format of show-episode.eyetv. Right-click, then Show Package Contents, to view the files inside Double-click the .mpg to watch it. By coincidence this is one of those recordings with the wrong show recorded, Master Chef instead of Agents of SHIELD, likely due to a sporting event or something. Easy enough to deal with, and the Indigo update isn't anything major, so my only real holdup is the Drobo 8D.
-
Probably around the time you finish Robot City 😉 (reply 60 for those who've not see this awesome WIP before). As it is, I've finally restarted work on the Harmony/Melody Club. Have posted the instructions for Virtual Machine setup for those not on Linux, am now working on the instructions for installing dasm and the ARM compiler. Looks like my Drobo 8D is another holdup for the Catalina update:
-
Not sure what's up, but after I reinstalled everything dasm worked as expected. So I need to now work up instructions for dasm and the C compiler. However, that'll be next week as I have out of state family coming for a visit this weekend, plus I'm getting things ready for my new TV.
-
Moved the TV over so I can get the area prepped for the new TV stand. While doing so I knocked over one of the speaker stands and the weighted bottom shattered. The plastic that enclosed the weight material is so brittle it shatters to the touch.
