CPCWiki forum

General Category => Programming => Topic started by: Lone on 10:02, 16 February 16

Title: Autorun function in basic
Post by: Lone on 10:02, 16 February 16
Hello,


As an emulator author, I planned recently to add an "autorun" feature, when inserting a disk (as it would be easier to test those gazillion of dump).
As know, I'm able to compute the command I would like to run, but I'm stuck on two particular points :


1/ I want only to use that command on the basic prompt (as I don't want to mess thing if i'm in the middle of a game). As now, i don't have any clue about what I can check to be sure I'm not in a middle of a program execution... I though about some AMSDOS variables, or maybe watching the stack pointer....


2/ I want to run it efficiently : I'm able to use an "autotype" method, but I find it not so smart. So, I planned to patch the memory with a basic line and run it.
I found I can copy my command line at the &AC8A address ( &ACA4 for Basic 1.0), and write a carriage return in the &b62a area, but it seems to have really strange beahaviours. Also, I though that I can just set the Program counter to the |CPM address, but it seems to be not that simple...


Any idea ?

Title: Re: Autorun function in basic
Post by: TotO on 10:16, 16 February 16
I thing that is wasting your time to support something that is not related to a CPC feature.
And, peoples love to type "CAT/RUN"... It is part of fun. :D

By the way, on a real CPC, it is possible to autoboot on a CP/M floppy disc by setting properly a jumper.
Do you support this feature ?

I think that should be extended to a RUN"DISC" (or something else) patching the firmware.
Understand, the CPC need a reset to autoboot, so you don't have to check if a program is running or not.
Title: Re: Autorun function in basic
Post by: arnoldemu on 10:29, 16 February 16
Quote from: Lone on 10:02, 16 February 16
Hello,


As an emulator author, I planned recently to add an "autorun" feature, when inserting a disk (as it would be easier to test those gazillion of dump).
As know, I'm able to compute the command I would like to run, but I'm stuck on two particular points :


1/ I want only to use that command on the basic prompt (as I don't want to mess thing if i'm in the middle of a game). As now, i don't have any clue about what I can check to be sure I'm not in a middle of a program execution... I though about some AMSDOS variables, or maybe watching the stack pointer....


2/ I want to run it efficiently : I'm able to use an "autotype" method, but I find it not so smart. So, I planned to patch the memory with a basic line and run it.
I found I can copy my command line at the &AC8A address ( &ACA4 for Basic 1.0), and write a carriage return in the &b62a area, but it seems to have really strange beahaviours. Also, I though that I can just set the Program counter to the |CPM address, but it seems to be not that simple...


Any idea ?
With Arnold, I poke into ram and force a double reset. Double reset to get to basic on Plus with it's menu.

I then watch for the keyboard to be read and start to output chars. This works most of the time.

Title: Re: Autorun function in basic
Post by: arnoldemu on 10:30, 16 February 16
Quote from: TotO on 10:16, 16 February 16
I thing that is wasting your time to support something that is not related to a CPC feature.
And, peoples love to type "CAT/RUN"... It is part of fun. :D

By the way, on a real CPC, it is possible to autoboot on a CP/M floppy disc by setting properly a jumper.
Do you support this feature ?

I think that should be extended to a RUN"DISC" (or something else) patching the firmware.
Understand, the CPC need a reset to autoboot, so you don't have to check if a program is running or not.
Arnold supports the autoboot. It forces the disc rom to be 0. The disc rom detects this and then forces a cpm boot.
Title: Re: Autorun function in basic
Post by: Lone on 11:02, 16 February 16
Thanks for these replies !


But I have more questions :


- @TotO (http://www.cpcwiki.eu/forum/index.php?action=profile;u=290) : Do you have any information about this jumper (I don't support it.. In fact until this morning, I didn't know it's existence !) ? A little search on the wiki give lot's of indormations about lots of jumper, but maybe too much ( and none about this one). Maybe it has something to do with setting the disk rom to '0' ?


- @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) : Do you have a feature for disabling this autoboot automaticaly (since it should not be used if a game ask about inserting the 'B' side of a disk - A reboot should not be the solution here !)


I'm trying to set up the best solution for lazy user (like me !) : Inserting a disk and launching it, but with no need to disable the feature for multi-disk games...
I have too much dump to test, and my emulator begin to be a bit too fast for my computer or my fingers : typing 'run"disc' often end with something like '"rruuunnnnnn"dissccccc'...


By the way, expect a big speed improvement for next release of sugarbox !


Title: Re: Autorun function in basic
Post by: TotO on 11:27, 16 February 16
In the DDI-1, LK1 connects both to the Expansion Port /EXP pin (which goes to PPI Port B, Bit5) and to the AMSDOS ROM bank number selection logic. The latter one allow to map AMSDOS to bank 7 (default), or bank 0. If AMSDOS sees itself mapped to bank 0, then it does automatically load & start the boot sector from drive A (equivalent as when typing |CPM after power-up).

On 6128, /EXP is linked but AMSDOS is always ROM7...  :-\

In all cases (this method or others), I think that you have to reset the CPC to autoboot with your emulator to not handle special cases.
Title: Re: Autorun function in basic
Post by: Kris on 11:36, 16 February 16
The RoDOS Rom us the autoboot feature (RUN"DISC by default); why don't you try to modify-improve this rom ?

Title: Re: Autorun function in basic
Post by: Lone on 11:48, 16 February 16

@TotO (http://www.cpcwiki.eu/forum/index.php?action=profile;u=290) : Thanks, I'll have a look and put it configurable (as soon as I will rewrite the whole configuration thing !)

@Kris (http://www.cpcwiki.eu/forum/index.php?action=profile;u=175) : In fact, I wanted to be the less intrusive possible, without any ROM change... But that's an idea !

Title: Re: Autorun function in basic
Post by: TotO on 12:00, 16 February 16
Your welcome. Here, some interesting informations: LK Links - CPCWiki (http://www.cpcwiki.eu/index.php/LK_Links)
(my post edit was done while you have answered)
Title: Re: Autorun function in basic
Post by: arnoldemu on 14:01, 16 February 16
Quote from: Lone on 11:02, 16 February 16
- @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) : Do you have a feature for disabling this autoboot automaticaly (since it should not be used if a game ask about inserting the 'B' side of a disk - A reboot should not be the solution here !)
I have a autostart media menu item for the autoboot. (it autostarts discs and tapes and binary files with headers and discovers the best command to type which is not always possible because there may be too many to make a good decision).

If user wants to insert side B then they need to use insert disk menu item in my emulator.
Title: Re: Autorun function in basic
Post by: Gryzor on 11:35, 26 February 16
Quote from: TotO on 10:16, 16 February 16
I thing that is wasting your time to support something that is not related to a CPC feature.
And, peoples love to type "CAT/RUN"... It is part of fun. :D


Well, true, but the beauty of it is that you can build single exe's including the emu and game, like what thecompany.pl does with Amiga. It's very handy, especially for people outside the particular scene. Why, just yesterday I discovered a (younger) colleague didn't know about Lemmings. Instead of him trying to figure out what an Amiga is,  just handed him the package containing all Lemmings games to run.
Title: Re: Autorun function in basic
Post by: ZbyniuR on 13:21, 26 February 16
Years ago, I had a few wires from keyboard to drive and connected in such a way as to insert disk without touching keyboard caused RUN"0
Nearly all my floppys was started from file "0". Some of them has menu to choose program by digit, and (0) started "0" again, so change disk caused run new menu or new disk still without touching keyboard. Commodore holders was impressed and jealous. :)
Title: Re: Autorun function in basic
Post by: Gryzor on 20:10, 26 February 16
Quote from: ZbyniuR on 13:21, 26 February 16
Years ago, I had a few wires from keyboard to drive and connected in such a way as to insert disk without touching keyboard caused RUN"0


.....but how??
Title: Re: Autorun function in basic
Post by: ZbyniuR on 22:16, 26 February 16
I'm Polish, we can do such a stuff. ;)

I stick cables from keys Ctrl, Enter, F0 and left arrow close together on piece of wood in right order, and some piece of metal stick on moving part with disk inside, and in moment when it move down to head, just stick those cables together for part of second. Voila. :)

It could be easier if same keys have it RUN"0 on one key, for example on Fire3, then only 2 cables is enough to do this, but it's need modify ROM too. Thats one of reason why I looking for how to do this.
Title: Re: Autorun function in basic
Post by: Gryzor on 19:39, 14 March 16
Sounds very steampunk :D
Title: Re: Contrived contraptions or doomsday devices?
Post by: OCT on 19:53, 14 March 16
Quote from: ZbyniuR on 22:16, 26 February 16
I'm Polish, we can do such a stuff. ;)

I stick cables from keys Ctrl, Enter, F0 and left arrow close together on piece of wood in right order, and some piece of metal stick on moving part with disk inside, and in moment when it move down to head, just stick those cables together for part of second. Voila. :)
I hope you weren't the one who had installed a similar (wooden!) contraption in the Control Room of a Soviet-style pressurized-water nuclear reactor.  ;D (Not in Poland, but nearly blew neighbouring nations' collective minds when it was discovered after lifting the Iron Curtain  :o ).
Title: Re: Autorun function in basic
Post by: Gryzor on 19:56, 14 March 16
Well, still probably safer than For 20 Years the Nuclear Launch Code at US Minuteman Silos Was 00000000 (http://gizmodo.com/for-20-years-the-nuclear-launch-code-at-us-minuteman-si-1473483587)
Powered by SMFPacks Menu Editor Mod