Scancodes: Key used for F10 Cheats

Request patches for Keens 4-6.
Post Reply
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Scancodes: Key used for F10 Cheats

Post by Nisaba »

I'm currently building a handheld console with just a limited set of buttons (8x buttons plus D-Pad). which means I need to get creative with the keyboard/button mapping in order to make use of the F10 cheat codes. My idea is to manipulate a couple of F10 key related patches. to do so, I need some help with the Scancodes.

list of buttons I have in use:
  • Ctlr
  • Alt
  • Space
  • Enter
  • Esc
  • F10
  • F1
  • Y
patches I use to simplify things:

Code: Select all

#Don't need debug mode to use F10 cheats
%patch $7AB7 $90 $90 #Keen 4
%patch $7A72 $90 $90 #Keen 5
%patch $784B $90 $90 #Keen 6

patches I'm looking for:
  • Level exit cheat:
    F10 + E --> F10 + Y
  • God Mode cheat:
    F10 + G --> F10 + Alt
  • Item cheat:
    F10 + I --> F10 + Space
  • Jump cheat:
    F10 + J --> F10 + Ctlr

I tried to build these patches myself but unfortunately hadn't much luck with the scancodes. So I'm hoping for some help and maybe a bit of elucidation. thanks in advance.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Scancodes: Key used for F10 Cheats

Post by levellass »

[FUCK KEEN MODDING]

The first thing to do is to get the basic scancode for each episode. For example, for Keen 4 this is $C647. There is also a list of the value of each key. For Keen 4 we get the following patch from F10-E:

Code: Select all

#Win level keys
%patch $74A0 $C66BW #E

As a quick check we take C647 from this: C66B - C647 = 24. Then we halve this, 12. Looking at the scancode key list we see this is the value for 'E'

What we want to change this to is 'Y'. On the list this is $15. First we double this to $2A, then add this to C647 to get $C671W:

Code: Select all

#Win level keys
%patch $74A0 $C671W #Y

We can check this on the F10-Y page:

Code: Select all

#Reveal secrets key
%patch $77FC $C671W #Y

You should be able to repeat this process with the other two episodes of Keen and check your values too. If you're still having trouble well, reply back.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Scancodes: Key used for F10 Cheats

Post by levellass »

Ok, so can I write the explanation here? No, seems not. Keen modding hates you.

But above I linked to three pages, the scancodes page, F10-E and F10-Y. You'll want to open those up before you start anything. Also I missed out a lot of stuff because again it wouldn't let me post anything. Between this and Szemi fuck patching. I spent ten minutes on that explanation.


Also, if anyone cares (I doubt it) the specific error was 'No route found for "GET /posting.php" (from "posting.php?mode=reply&f=24&t=2816")'
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Re: Scancodes: Key used for F10 Cheats

Post by Nisaba »

ah, I see!
thanks for the explanation. even if I can't read those words, I still can feel 'em...

as I tried it before I did everything quite similar but missed the doubling aspect. why on earth do I have to double the values? everything else is pretty much self-explanatory, thanks to the wiki sections (<-- written by someone called levellass).

just in case anybody else is interested:
http://www.shikadi.net/keenwiki/Patch:Scancodes
http://www.shikadi.net/keenwiki/Patch:Cheat_codes
http://www.shikadi.net/keenwiki/Patch:F1-F12_keys
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Re: Scancodes: Key used for F10 Cheats

Post by Nisaba »

I was thinking: why not change the key which is used for the quit menu as well. this could give me some liberty in the button arrangement.
so for the next step I'm looking for a patch (since I cannot discover anything related), which changes:
  1. the dialogue from "PRESS Y TO QUIT" into "ENTER TO QUIT"
  2. the Scancodes for the old/new key
Image

any ideas?!


EDIT:
ok here is the answer to part a)

Code: Select all

Patch: Keen 4
#Text
%patch $1AFCE $495DW #Really
%patch $1AFD3 $496AW #Press
%patch $337CD "REALLY QUIT?" $00
%patch $337DA "PRESS Y TO QUIT" $00
%patch $33792 "ESC TO BACK OUT" $00

%patch $337A2 "REALLY END CURRENT GAME?" $00
              "PRESS Y TO END IT" $00

%patch $337EA "YOU'RE IN A GAME" $00
              "PRESS Y TO LOAD GAME" $00
              
%patch $33810 "YOU'RE IN A GAME" $00
              "PRESS Y FOR NEW GAME" $00
alternatively:

Code: Select all

Patch: Keen 4
#Don't ask if player wants to quit
%patch $1AFA7 $EB
aha, and this is the solution to part b)

Code: Select all

#Y key -Keen 4:
%patch $1AF68 $15
http://www.shikadi.net/keenwiki/Patch:Q ... xy_windows
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Scancodes: Key used for F10 Cheats

Post by levellass »

The doubling here is because there is an array of 'keys pressed' values in memory, each of which is two bytes long. (There IS a 'last key pressed' value which is used for things like the control panel, but it can be tricky to use.) Glad to see all the keys are working out for you.
Post Reply