How to modify function keys in OS6128.ROM ?
I mean like in KEY command not like in KEY DEF. Anyone know?
Quote from: ZbyniuR on 00:50, 21 February 16
How to modify function keys in OS6128.ROM ?
I mean like in KEY command not like in KEY DEF. Anyone know?
Function Keys with the Key command should be 128 for F0 through to 137 for F9, wasn't sure if that's what your after though.
I know how it works in Basic. But how to change meaning some function keys for good. For example if I want key [F.] work as "LIST" instead of "."
Which bytes in ROM file I have to change for it?
I found place where is RUN" from Ctrl+[Enter] but I don't see where is meaning rest of function keys. :(
So in the Firmware manual there's KM SET EXPAND (&BB0F), which is the equivalent to BASICs KEY.
I just typed this up, which causes the F0 key to list:
org &4000
ld b,128
ld c,5
ld hl,command
call &bb0f
ret
.command
defb "LIST"
defb &0d
I'm not sure how you would go about fiddling with the 6128 ROM so your function keys become commands.
The easiest approach would be to make a ROM from the program above, it would also mean it doesn't have to rely on a specific model.
Thanks for your good intentions but it is not what I need. I do not know assembler, but I can find POKE. I want to change the original ROM and not add another. :)
In RAM function keys are defines at &B590, and looks quite clearly. 1 byte determines how many characters has a string in function, and then there are these signs. If function is empty there is &00.
In ROM the only place where &B590 address is mention is at &5B9F. (I loaded ROM into RAM at &4000). A few lines below you can see the last 3 defined function keys No. 10 [.], 11 [cr] and 12 [RUN"cr]. In the same form as in RAM. But in between is black magic. I suppose that there is a program something in style: FOR k=0 to 9:KEY k,CHR$(ASC("0")+k):NEXT Although it looks too long and complicated. If this can be modified into like this: FOR k=128 to 159:KEY k,CHR$(k):NEXT and then add a KEY 129, RUN"[cr] I'd be glad. Or even more happy if I could put there strings exactly as it is in RAM. It seems like there is enough space. :)
KEY DEF under basic.
or cpctech.cpc-live.com/docs/firmware.pdf
This document lists the rom locations which may be different on Basic v1.1 and basic v1.0.
EDIT: There may be a "string descriptor" for each key. 1 byte length, 2 bytes address of string.
KEY DEF - change keys map, not strings in function keys.
I need it already after reset, not after load from disk.
Firmware show what is where in RAM, not how to modify ROM. :(
I asked on other forums too, and I have some idea which I must check.
Any way, how hard it can be? ;)
Quote from: ZbyniuR on 00:46, 22 February 16
I need it already after reset, not after load from disk.
If it's just a soft reset, that assembly program I made could be relocated to a spot in memory which would survive a soft-reset like &af00 I think or in the extra 64k would survive a soft-reset.
Quote from: ZbyniuR on 00:46, 22 February 16
Any way, how hard it can be? ;)
I think based on what @arnoldemu (http://www.cpcwiki.eu/forum/index.php?action=profile;u=122) wrote, the ROM only assigns the Key Map, I don't think you can assign a command to it, unless it's a matter of using the Token value of a BASIC command & having that come up when you press your F0-F9 key, though I haven't got any detail regarding what goes where in the ROM.
@ZbyniuR (http://www.cpcwiki.eu/forum/programming/how-to-modify-function-keys-in-rom/msg120646/#msg120646):
cpctech.cpc-live.com/docs/os.asm
1eef -> 1fe8 is the translation table.
this is cpc6128 os rom.
is this what you wanted?
If you want to press a key and to give basic commands (key def) then here it is in rom:
1c3c-1c46
1c3c defb &01 defb "." defb &01 defb 13 defb &5 defb "RUN""",13
there is no space in the rom to add more.
If you want to add more (e.g. f1 key does "CAT") you need to make an expansion rom.
@ZbyniuR (http://www.cpcwiki.eu/forum/programming/how-to-modify-function-keys-in-rom/msg120646/#msg120646)
Possibly have look inside the "" Utopia.rom ""
This has imbedded commands. on Page 5 of the pdf
Ray
That's precisely why I uninstalled Utopia. Replacing the CTRL+ENTER RUN" shortcut with RUN"DISC? Unacceptable!