Page 2 of 4

Flash ROM from the X16

Posted: Mon May 10, 2021 3:04 pm
by Scott Robison


2 hours ago, ZeroByte said:




Me, I’d put a file browser or a command shell in ROM, along with a file viewer/editor that displays in PETSCII, ASCII, or hexdump formats. 



After that, I’d say an assembler.



While my BASIC-like peer project isn't going to be an assembler per se, I was planning to allow some sort of "inline assembly" first class feature so that those portions that would benefit could use it.


Flash ROM from the X16

Posted: Tue May 11, 2021 4:44 am
by Stefan

Considering what Lorin said above in this thread I will probably remove my PR for a START command.

I now have a much simpler implementation for a FARSYS command.

Example: FARSYS $C000,7 will jump to address $C000 in ROM bank 7.

It seems to work, but I will look at the code a bit more before pushing that.

Even if flashing the ROM will be somewhat complicated/risky, it's reasonable to believe quite a few will try that anyway. The FARSYS command would be useful for those.

Do you think the name of the command should be shortened to FAR?


Flash ROM from the X16

Posted: Tue May 11, 2021 8:44 am
by desertfish

just FAR is too confusing IMO , it's a SYS call you're doing after all, just to another Rom bank.   Perhaps FSYS?   (in the spirit of VPOKE/VLOAD) 


Flash ROM from the X16

Posted: Tue May 11, 2021 3:43 pm
by Stefan

I made the pull request now. As suggested by @desertfish, I'm calling it FSYS.

https://github.com/commanderx16/x16-rom/pull/213


Flash ROM from the X16

Posted: Tue May 11, 2021 5:55 pm
by Scott Robison

I think "BOB" would be a good command for a far sys... ? Or not...


Flash ROM from the X16

Posted: Tue May 11, 2021 10:38 pm
by Scott Robison

In all seriousness, C128 had an extended SYS command: SYS address,a,x,y,s

Where a,x,y,s were optional and were used as values for the given registers if given.

I would think a better solution for X16 BASIC is to just extend the SYS command to be "SYS addr,bank,a,x,y,s" where bank can be ROM or RAM based on the address provided. That way it allows setting of register values and SYSing into either ROM or RAM banks depending on the context, just like JSRFAR does.

 


Flash ROM from the X16

Posted: Wed May 12, 2021 4:33 am
by Stefan


5 hours ago, Scott Robison said:




In all seriousness, C128 had an extended SYS command: SYS address,a,x,y,s



Where a,x,y,s were optional and were used as values for the given registers if given.



I would think a better solution for X16 BASIC is to just extend the SYS command to be "SYS addr,bank,a,x,y,s" where bank can be ROM or RAM based on the address provided. That way it allows setting of register values and SYSing into either ROM or RAM banks depending on the context, just like JSRFAR does.



 



Are there any vararg functions in the current BASIC implementation? I'm not aware. A vararg SYS command could be a lot of work. I don't know if it's worth it.

There is much less need for a FAR SYS command that lets you jump to banked RAM. The RAM bank can easily be switched from BASIC with a POKE 0,[RAM BANK] before using the standard SYS command.

My implementation of FSYS does only switch ROM banks.


Flash ROM from the X16

Posted: Wed May 12, 2021 5:33 am
by Cyber

I agree with Lorin's approach, that certain requirements have to be met like jumper and so on. And I don't see how this interferes with adding custom file browsers, viewers, editors or even making a completely custom ROM. This really should not be casual. Why would one need a BASIC command that could be executead at any time?


Flash ROM from the X16

Posted: Wed May 12, 2021 6:12 am
by Scott Robison


1 hour ago, Stefan said:




Are there any vararg functions in the current BASIC implementation? I'm not aware. A vararg SYS command could be a lot of work. I don't know if it's worth it.



There is much less need for a FAR SYS command that lets you jump to banked RAM. The RAM bank can easily be switched from BASIC with a POKE 0,[RAM BANK] before using the standard SYS command.



My implementation of FSYS does only switch ROM banks.



That's a good point. Twas just an idea. ?


Flash ROM from the X16

Posted: Wed May 12, 2021 2:19 pm
by Stefan


8 hours ago, Cyber said:




I agree with Lorin's approach, that certain requirements have to be met like jumper and so on. And I don't see how this interferes with adding custom file browsers, viewers, editors or even making a completely custom ROM. This really should not be casual. Why would one need a BASIC command that could be executead at any time?



The purpose of the command is not to program the ROM, but to start a program that resides in ROM.

The command is needed as you cannot change ROM bank in BASIC. Typing for instance POKE 1,[ANY ROM BANK BUT 4 WHERE BASIC IS STORED] will typically crash the BASIC environment.

Without a FAR SYS command, you would need to type in a machine code startup stub in RAM with the MONITOR each time the computer is started. That is not very practical. Or load the startup stub from the SD card, which is also a bit cumbersome.