Hello, Guest the thread was called2.2k times and contains 56 replays

last post from LGB-Z at the

Xemu Windows to MEGA65 keyboard mapping

  • Yep sure, happy to share any findings, perhaps a trophy moment video of my first flashing c65 basic text :-D

    Just as an aside, to explain where my fascination with these minor things like the monitor and flashy text came from:

    Growing up, I only ever had a c64. No upgrades to c128 or amiga. No regrets there, I was very happy with my c64, but was occasionally jealous when hearing about newer machines having better versions of BASIC with more advanced graphics and sound commands, in-built monitors and even in-built sprite editors, sheesh!

    So I suppose exploring all these little perks and extras now on the mega65, even as an adult, seems to generate some sort of excitement in me, a joy of finally getting a taste of what I missed out on back then :-)

  • Ok, I gave "dev" branch a try just now, all good.

    I gave the BASIC escape sequences from the c65 txt manual a try, was interesting, some modest but nice improvements over the c64 editor. Nice to have shortucts for getting to the start/end of a line quickly, inserting a new line above.

    I'd misread the 'flashing mode', thinking it would flash the text. Instead, it would turn the flashing of the cursor on or off.

    Sadly couldn't get the bold text option working. They hinted in the text that it only worked for colours 16-31, not sure how to select such colours from the keyboard though.

    Being able to switch the editor into 'insert' mode felt surreal, interesting experience, after so many years of tolerating BASIC v2's OVERWRITE mode :)


    --- ----------------------------------------------------

    @ Clear from cursor to end of screen

    A Enable auto-insert mode

    B Set bottom of screen window at cursor position

    C Disable auto-insert mode (set overwrite mode)

    D Delete current line

    E Set cursor to non-flashing mode

    F Set cursor to flashing mode

    G Enable bell (control-G)

    H Disable bell

    I Insert line

    J Move to start of current line

    K Move to end of current line

    L Enable scrolling

    M Disable scrolling

    N Normal screen fields [not implemented on C64DX]

    O Cancel insert, quote, reverse, underline & flash modes

    P Erase from cursor to start of current line

    Q Erase from cursor to end of current line

    R Set screen to reverse video [not implemented on C64DX]

    S Set bold attribute (VIC-III colors 16-31)

    T Set top of screen window at cursor position

    U Unset bold attibute

    V Scroll up

    W Scroll down

    X Swap 40/80 column display output device

    Y Set default tab stops (8 spaces)

    Z Clear all tab stops

    [ Set monochrome display (disable attributes)

    / Cancel insert, quote, rvs, ul & flash modes

    ] Set color display (enable attributes)

    I did manage to see flashing text via other means though:

    PRINT CHR$(15);"HELLO"

    Underlined text worked like this:


  • Sounds interesting! I have to admit, there can be bug in Xemu too (or at least lack of emulation ...) to have those extended attributes, at least all of them ... So it's not clear at this point if it should work, and only Xemu's VIC-III emulation does not handle it, or other problem. If I have time, I will simply set video RAM / colour RAM manually to see, if I see the desired result at least according to c65manual, since the extended attributes seems to have kinda chaotic, if I remember exactly. But anyway, it's even not sure, that a real C65 would do the same as the M65 FPGA implementation, and then we haven't even talked about Xemu's emulation of C65 or M65 to be precise ...

  • Yeah, I'll be curious to give this a try soon, as I was reading in the c65 txt manual about how the BASIC editor mode supports new text attributes (flashing? Underline?) and thought it might be fun to give those a try, but the catch was I need to press the c65's escape key to start typing their escape sequences.

    So will give the dev branch a try to see if I can get a kick out of seeing flashing and underlined text in BASIC :-D

    You can access them in the meantime, by doing PRINT with CHR$(27) for ESC -- just compose a string with the correct sequence of characters and print it.


  • This is what I am using so far. Not everything has been located. But as you said, not every key may be mapped.

    Thanks for the keymap table! :thanx:

    I've search the INSERT key on the Xemu (Mega65) and tried nearly everthing. One look in your table and I know that I have to press SHIFT+BACK for that. :thumbup:

    Not so surprising, since those functionalities on the same physical M65 (C65, even C64) key, so it must be the same key on the emulator as well. Ie positional mapping instead of symbolic mapping. Indeed, it wouldn't be impossible to break this rule, but quite hard to do it right, when a shifted key on C65/M65/C64/etc is not shifted on the emulator, or vice-versa, often renders even compatibility problems, since the shift key also sensed and can be seen for the emulated matrix which shouldn't etc.

  • Anyone used xemu on a macbook? How did you find the keymappings there?

    I had a small dabble tonight and noticed that I can't type a '+' character, as it is mapped to the windows 'Insert' key, which the macbook doesn't have.

    Maybe I could try map some key combo to equate to the insert key via info mentioned here:


    but maybe it's overkill... Anyways, just thought I'd mention :)

  • i don't own a Mac. sorry i can't help you.

  • Snoopy z ah yup, I gave fn+enter a try, but it instead awapped the josytick port :-( No worries LGB-Z, whenever time permitting :-) maybe i just tweak the mapping in the source for now

    SDL_SCANCODE_KP_ENTER is that key. So on SDL level it senses that as the numeric key-pad enter, which is hard-coded as swapping the emulated joystick port. Hmmm. One annoying factor here, that there can be some "hidden" hard coded things must be modified even after this project it seems. The other interesting part, that according to SDL2, it seems FN+ENTER is actually the keypad enter ... I can't modify the later, since it's OS/SDL/etc level stuff ...

    Btw, many "strange" keys are hard-coded into Xemu, like swap-joystick ports. From the time when there was no other possibility. As we have some kind of popup menu, it's more sane to move those into the proper place and do not clutter other key with some "hidden" function ;)

  • Heya Gabor,

    There were a few mac users on discord discussing their issues with xemu on a mac. Thought I'd share their experiences here to put it on your radar too.

    There were some problems accessing the function keys. This surprised me, as function-keys work fine on my macbook, but I feel it's because I changed a setting to allow me to use the function keys directly (by default, a mac's function keys perform various special functions, like adjust screen brightness and volume control. So if a typical mac-user wants the original F1/F2/F3 keys, they hold down the fn-key while pressing the F1 key. I didn't like it that way, so swapped the setting around).


    (I wanted to add a screenshot of this keyboard setting, but this doesn't seem to work anymore in forum64.de?)

    As for my past experiences, there was:

    1) Having trouble using M65's '+' key, as it is initially mapped to 'INSERT', which on the macbook, is handled by pressing fn+ENTER

    2) Also had trouble with M65's 'RUNSTOP' key, as it is initially mapped to 'END', which on the macbook, is handled by pressing fn+right-arrow

    So yeah, these fn-key combinations seem to be problematic in xemu presently.

    Think this was on your radar already, just wanted to summarise the various mac-related pain-points being seen so far.

  • Well, I don't have any Mac, never had, but sure, make some suggestion how to arrange things. But I would need SDL2 scan code symbols, without Mac I can't figure that out :(

  • That's alright man. Maybe some of us mac users will get a chance to dabble with your source and see what we can get working in relation to this psky mac-specific fn key

    I'm more than happy to help anyone, just without a Mac I can just rely on others to submit something, I can't ... I haven't had even a clue that Mac does not have INS key :-O