SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
29 stars 5 forks source link

illustrate c65 block device alternative to block-ramdrive-init #72

Closed patricksurry closed 4 months ago

patricksurry commented 4 months ago

this would be easy and save some space. happy to take a look at it

SamCoVT commented 4 months ago

One of the reasons that I like block-ramdrive-init is that it can be used on real hardware before people actually wire up storage to their boards. Because of that, I don't think I want to get rid of it. There may still be room for improvement, even if block-ramdrive-init is kept. It's currently an evaluated string.

From a simulation point of view, if you want to show using the c65 simulator with its block device as an example, that sounds wonderful. It works well as a simulator (as long as you don't need breakpoints or other features of py65mon) and the simulated block device is simple enough to be a good example, while also not being too far removed from what simple storage (eg. no file system) actual hardware will be like.

If it had options/commands for breakpoints, single stepping, breaking out of and resuming simulation, and viewing and editing memory then I think c65 could replace py65mon entirely. I don't know if you are interested in going that far.

patricksurry commented 4 months ago

that's a good point, i've relabeled this to illustrate as an alternative config if folk want to use larger block storage

SamCoVT commented 4 months ago

Your #73 looks good. Do you want to add instructions or a makefile target for building c65? make -C c65 from the main project directory should do the trick and we could add a c65 target to the main Makefile.

Also, just FYI, c65 does not compile natively on windows using the mingw compiler because select.h is a POSIX thing. We'd need a Windows specific version of io.c if we wanted it to work natively on Windows. It works fine on WSL, so I don't think it's an immediate issue and WSL can be our recommended method for use under Windows.

gcc -o c65 c65.c io.c
io.c:6:10: fatal error: sys/select.h: No such file or directory
    6 | #include <sys/select.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [c65] Error 1
patricksurry commented 4 months ago

Updated the makefile with a c65 target and more comments, and created a new issue for native window c65 port. Test with something like make clean ; make ctests

SamCoVT commented 4 months ago

I added the .c and .h files to the main Makefile so that c65 will be rebuilt when the ctests or csim targets are used. That would let someone add virtual hardware to c65, for example, and make csim would then recompile c65 if it hadn't been already.