scotws / TaliForth2

A Subroutine Threaded Code (STC) ANS-like Forth for the 65c02
Other
86 stars 23 forks source link

Move memory map to config file to make porting to different hardware designs easier #138

Closed scotws closed 6 years ago

scotws commented 6 years ago

The memory map is currently defined in definitions.asm, which makes it harder to adapt Tali Forth 2 to different hardwares. It makes more sense to move these parts to the platform-*.asm files where they are easier to maintain for different hardwares.

This is based on a suggestion by Thomas from the Steckschwein crew after VCFB 2018 (https://steckschwein.de/2018/10/13/vcfb-2018-its-great/). Their homebrew 65c02 has its I/O addresses mapped right where Tali's input buffer is.

SamCoVT commented 6 years ago

I second this.
My I/O takes up 256 bytes at the top of the 32K RAM, which is of course where we put the input history. I have my own unique definitions.asm that I have to keep separate. I currently use a separate hardware/sbc branch for this in git, but I have to remember to switch branches before building for my hardware and back before I build for py65mon. If I forget to switch and build for my hardware, I can write about 3 commands before I start typing directly into my ACIA configuration registers :) I've done it enough times that I know the symptoms now.

It would be nice to move them to the platform-*.asm file as it's OK to have multiples of those in the same folder, and the makefile makes it easy for me to build for my hardware by just saying

make sbc

(My file is named platform-sbc.asm)

scotws commented 6 years ago

A platform folder sounds like a splendid idea! We could let people "upload" (PR, actually) their versions, which makes life easier for them, and also serves as a library for people creating their own variants. We'd have to add a README.md to explain what uploading entitles and some instructions on what needs to be changed to adapt those files. The volume should be manageable - somehow, I doubt that we'll have to deal with thousands and thousands of people sending us their platform files for Forth on 65c02 machines :-).

The problem here is that I actually don't have a hardware version of the 65c02 (my breadboarded Übersquirrel is frozen half-way to an upgrade to a 65816), so I have no way of testing this sort of change. Also, I seriously suck at make. Could I ask you to look into this?

scotws commented 6 years ago

The Steckschwein people, BTW, say that Zero Page is not so important for them. What they would really like would be to be able to "move Tali Forth down" in the memory range, say to $1000, and have RAM be everything after Tali till $D7FF (you can see their memory map here: https://steckschwein.files.wordpress.com/2018/10/the-history.pdf). I'm not sure if that is as easy as redefining the memory addresses in a config file, or if we actually have to face the question of relocation. Which sounds like a new issue.

SamCoVT commented 6 years ago

Feel free to assign this one to me and I can take a look at it. I think Tali should be relocatable like you want, and I can test that on my hardware by loading my old monitor program and using xmodem to load it into RAM. While I'm in the Makefile, I'd also like to add a testing target so I can just say make tests after building Tali.