OLD doesn't work if you have AUTOBOOT.X16

This is the starting place for reporting bugs to the team. We will pass bug reports on to the developers after validating the reports.

You can report bugs in hardware, operating system (KERNAL or BASIC ROMs), the emulator, or the Demo library. For bugs specific to downloaded programs, use the download forum.
Post Reply
mobluse
Posts: 172
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

OLD doesn't work if you have AUTOBOOT.X16

Post by mobluse »

I try to use OLD after NEW to get my old program back, but this doesn't work. If I remove my AUTOBOOT.X16 that was created using MENU it does work. I need to use AUTOBOOT.X16 in order to set my keymap. I tried to modify the AUTOBOOT.X16 by removing NEW at the end, but then it works strange and e.g. scrolls only the upper part of the screen (I had SCREEN 3 before OLD). But when you do OLD after NEW then you don't get back the old program, but AUTOBOOT.X16. Is there a way to modify AUTOBOOT.X16 so that OLD works in a normal way? Otherwise OLD is useless if you need to have another keymap.

I use R43 for aarch64.

My AUTOBOOT.X16 (and I also tested it without 13 NEW):

Code: Select all

0 COLOR$01,$06
1 SCREEN$00
2 POKE$9F29,$21
3 POKE$9F2A,$80
4 POKE$9F2B,$80
5 POKE$9F2C,$06
6 POKE$9F25,$02
7 POKE$9F29,$00
8 POKE$9F2A,$A0
9 POKE$9F2B,$00
10 POKE$9F2C,$F0
11 POKE$9F25,$00
12 KEYMAP"EN-GB"::::
13 NEW
BTW Why are there 4 colons after KEYMAP?
Last edited by mobluse on Thu Jun 15, 2023 7:04 pm, edited 2 times in total.
X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
TomXP411
Posts: 1732
Joined: Tue May 19, 2020 8:49 pm

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by TomXP411 »

Can you save the keymap to NVRAM? If you add the -nvram switch to your command line, you can save the config there and skip the autoboot file.
-nvram <nvram.bin>
Specify NVRAM image. By default, the machine starts with
empty NVRAM and does not save it to disk.
mobluse
Posts: 172
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by mobluse »

Thanks! That is a workaround.
X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
mobluse
Posts: 172
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by mobluse »

I now think that it is OLD that is the problem. It seems to load AUTOBOOT.X16, but I see no reason why it should do that. NEW seems to do the right thing: i.e. only delete the BASIC program. I think OLD should only restore the old BASIC program. There are other commands if you want to run AUTOBOOT.X16 e.g. BOOT, REBOOT, and RESET. AUTOBOOT.X16 in this case only contains 10 KEYMAP "EN-GB". See this session for proof:
2023-06-22-142259_640x480_scrot.png
2023-06-22-142259_640x480_scrot.png (14.04 KiB) Viewed 5432 times
X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
TomXP411
Posts: 1732
Joined: Tue May 19, 2020 8:49 pm

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by TomXP411 »

mobluse wrote: Thu Jun 22, 2023 12:34 pm I now think that it is OLD that is the problem. It seems to load AUTOBOOT.X16, but I see no reason why it should do that. NEW seems to do the right thing: i.e. only delete the BASIC program. I think OLD should only restore the old BASIC program. There are other commands if you want to run AUTOBOOT.X16 e.g. BOOT, REBOOT, and RESET. AUTOBOOT.X16 in this case only contains 10 KEYMAP "EN-GB". See this session for proof:
OLD isn't magic. It can only restore the program currently in memory; it can't go back in time and find old programs that have been overwritten.

If you reboot the computer, and it runs autoboot.x16, then of course OLD will restore that. If you want OLD to actually restore the program that was running when you hit reset, then you need to remove or rename autoboot.x16 so it doesn't run.
mobluse
Posts: 172
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by mobluse »

I understand that, but I'm using NEW and not RESET or Ctrl+R, and then OLD. It is OLD that runs AUTOBOOT.X16; not NEW. See previous screenshot for proof (unless I'm seriously mistaken). There is nothing in the documentation that says that OLD will run AUTOBOOT.X16: https://github.com/X16Community/x16-doc ... SIC.md#old
X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
kelli217
Posts: 513
Joined: Sun Jul 05, 2020 11:27 pm

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by kelli217 »

Let me see if I understand the problem.

So, you start the emulator. It runs the autoboot program "AUTOBOOT.X16" on startup, which sets your keymap, and then erases itself from memory by executing the NEW statement.

And then you load the program you want to use. Let's call it "EXAMPLE.PRG" just as a placeholder. You run this program and it does what it does.

Then you quit the program, and you type 'NEW.'

Then you type 'OLD' and rather than getting "EXAMPLE.PRG" back, you're getting "AUTOBOOT.X16" for some reason.

Is that right?
TomXP411
Posts: 1732
Joined: Tue May 19, 2020 8:49 pm

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by TomXP411 »

Huh. You're right, that's odd.

I even started with NO autoboot, saved a program as the autoboot, loaded a different program, ran an NEWed that... then typed OLD, and the autoboot ran.

I'll ping MooingLemur on this, but it does seem like OLD is processing the autoboot as if the system had just been turned on.
TomXP411
Posts: 1732
Joined: Tue May 19, 2020 8:49 pm

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by TomXP411 »

So it turns out OLD jumps to init2, which does indeed load and execute AUTOBOOT.X16.

So if you are programming, you should not have an AUTOBOOT.X16 file. Instead, change its name to something like AUTOBOOT.PRG and place it first in the root directory. Then SHIFT+STOP should execute it when needed.

I have opened a ticket, and hopefully this will be fixed in a future update.
mobluse
Posts: 172
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Re: OLD doesn't work if you have AUTOBOOT.X16

Post by mobluse »

Thanks! In my AUTOBOOT.X16 i didn't have NEW in order to see clearly what was going on.
X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
Post Reply