TIP: Click on subject to list as thread! ANSI
echo: cbm
to: ALL
from: PEKKA TAKALA
date: 2014-11-26 22:43:00
subject: Re: DirMenu64, 4 bytes sm

On 18.11.2014 16:26, Harry Potter wrote:
> I just cut the size of the C64 version of DirMenu by four more bytes.
> :)  I was using a string to store the file to run.  Now, I'm using
> the current selection # to determine the program to run.  I have a
> function that returns the address of the current selection and have
> been using that to display the menu and highlight the current
> selection.  If the user cancels or there is an error, the # is set to
> -1.  The filename is written to the screen using the aforementioned
> function.  Now, I can probably save a few bytes with the C128 version
> by replacing the printing of a quote and home characters to a
> character print of home.  The code is: ------------------------- 
> prints ("\f\n\nrU\""); prints (geteaddrcur()); prints ("\"\x13"); 
> *((char*)0xD0)=1; //# keys to write to buffer. *((char*)0x34A)=13;
> //Write one Return. --------------------------- I plan to change the
> second line to: --------------------------- prints (geteaddrcur());
> printc ('\x13'); ---------------------------- prints() is a function
> in my CBMSimpleIO library to print a string directly to the kernal's
> CHROUT routine, while printc() prints a single character.
> geteaddrcur() returns the address of the current menu option.
> 
> One more thing: the C64 version copies part of the LOAD/RUN command
> to the keyboard buffer using strcpy().  This saved me four bytes.
> Where is this on a Plus4/C16?
> 
Why not do the following:

Check where the READY prompt comes on the screen when you clear it
(should be third row). Send CHR$147, cursor control, Print the commands
to LOAD, parameters and RUN on screen to do the thing. Then write just
two chr$(13) to keyboard buffer and return with RTS. When Basic gets
back the control, it will execute the load command (because of the first
chr$(13). Then it loads it, and then continues with RUN when the ready
prompt from load comes out.



--- MBSE BBS v1.0.01 (GNU/Linux-i386)
* Origin: Elisa Customer (3:633/280@fidonet)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.