Page 2 of 3

Re: RENUM utility BETA

Posted: Thu Jan 19, 2023 12:18 am
by novemix
Hmm, yeah, if they're checking for F2 with a "reverse-shift-i" though, this could be a problem, hmm...

Re: RENUM utility BETA

Posted: Thu Jan 19, 2023 6:33 am
by TomXP411
novemix wrote: Thu Jan 19, 2023 12:18 am Hmm, yeah, if they're checking for F2 with a "reverse-shift-i" though, this could be a problem, hmm...
The good news there is that, to check F2, you're likely to do something like this:
GET A$:IF A$=CHR$($89) THEN do something
So I think you're safe on this one. Just noting that it's possible, and suggesting people use CHR$(89) and CHR$(8D), rather than entering the character code in reverse text, should be enough to prevent this from happening. (For the record, $8D is SHIFT+RETURN, so it's not something you can or should ever have in a quote string, either.

Re: RENUM utility BETA

Posted: Sat Mar 11, 2023 1:35 am
by TomXP411
Hi, Novemix. I was wondering if you ever made any progress on this?

I am working on a program that works in the banked memory, so I was hoping to talk you into assembling a version that loads into $400

Re: RENUM utility BETA

Posted: Tue Mar 28, 2023 4:32 pm
by nighthawk1961
I tried this utility but it doesn't seem to work correctly after the developers instructions were followed. I use v42 both since it is the newest version and because it allows the local file system to be drive 8 rather than the sdcard.img file. Any help I could get to use this wonderful utility would be greatly appreciated. Thanks.

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 12:07 am
by novemix
Hey, @nighthawk1961, I'll have to see what the issue is with R42.

And @TomXP411, $0400 probably isn't possible, I don't think the code is even small enough to fit, plus it needs space to build a table. But I'm sure I could change things where it could use a bank that the user specifies rather than what's currently active at runtime.

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 1:48 am
by BruceRMcF
novemix wrote: Mon Apr 10, 2023 12:07 am Hey, @nighthawk1961, I'll have to see what the issue is with R42.

And @TomXP411, $0400 probably isn't possible, I don't think the code is even small enough to fit, plus it needs space to build a table. But I'm sure I could change things where it could use a bank that the user specifies rather than what's currently active at runtime.
$0400 could be used for the main program entry point and to store the HighRAM segment number that contains the rest of the code.

Indeed, you could have a common prefix that generates a syntax error and a linked list of routine names and the HighRAM segment & routine addresses, and the $0400 code is just the syntax error entry point which parses the name, runs through the linked list looking for the matching name, and when found does a long call to that address in that HighRAM segment. Then once you have the base code for the $0400 routine, the only LowRAM overhead for adding another command line function is the name of the command and the segment & address of the code that implements the function.

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 3:09 am
by TomXP411
novemix wrote: Mon Apr 10, 2023 12:07 am Hey, @nighthawk1961, I'll have to see what the issue is with R42.

And @TomXP411, $0400 probably isn't possible, I don't think the code is even small enough to fit, plus it needs space to build a table. But I'm sure I could change things where it could use a bank that the user specifies rather than what's currently active at runtime.
As Bruce suggested, you can use another bank for the bulk of the code, or at least your table, but you can't have the Syntax Error hook pointing into a bank, because if the selected bank changes, the system will crash.

I'm going to suggest querying MEMTOP to see how much RAM is installed, then subtract one from the returned value as your bank number. Realistiaclly, you're going to get 0 (which is 256), or $40, which is 64.

So your routine would
  • read the active bank
  • save it to the stack
  • switch to bank $FF or bank $3F to perform the renumber
  • pop the previous bank back off the stack and switch back to that bank.

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 5:17 am
by TomXP411
FYI, @MooingLemur has added a RENumber command to the system ROM, so this has probably become redundant.

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 7:00 pm
by novemix
TomXP411 wrote: Mon Apr 10, 2023 5:17 am FYI, @MooingLemur has added a RENumber command to the system ROM, so this has probably become redundant.
Ah, very good. Is it in R42?

Re: RENUM utility BETA

Posted: Mon Apr 10, 2023 8:13 pm
by TomXP411
It's not in R42. He just checked it in yesterday, so it will be in the next major release.

If you want it sooner, you can go to the project page and look in the "Actions" tab for the latest build of the ROM. This ROM should work on the R42 emulator.

https://github.com/X16Community/x16-rom/actions