Welcome, Guest. Please login or register.


Author Topic: Xep128 (Read 78559 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #105 on: 2016.March.27. 03:15:50 »
You have understood on a week what cost me two years. At least sharper than mine....

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #106 on: 2016.March.27. 13:01:57 »
Just to tell, what my idea is with this console window stuff ... The usual place/name (I mean the exe file) :) Console window closes on normal execution. Now if you press the numeric keypad minus button (during the emulation already), console is shown. You can see a prompt there (Xep128> ). In the future, it will be possible to give "monitor" commands. Now it does nothing, whatever you enter, you will only get back some feedback on entered line, and also Z80 register values (and Dave "MMU" registers) are printed. But it will be possible to use memory dump, disassembly, break point declarations, etc commands ... I'm not a big fan of GUI, as you know, I like more these kind of stuffs :) Also it's much easier to implement in a platform-independent way (without also using a custom widget library, or writing GUI for multiple systems with their native ones errrr ....) so it's about the same on Linux for example (just there, the console is standard I/O, no system level console window. For Windows it's a must, because of the Windows policy on strict enforced difference between "console" and "GUI" applications ... Interesting that I learnt about Windows more than ever before during developing Xep128 heheheheee ...).
« Last Edit: 2016.March.27. 14:36:26 by lgb »

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #107 on: 2016.April.01. 16:48:40 »
I've just borrowed an X-box controller from a friend to write/test joystick emulation with real joystick/gamepad. It's funny, that it seems to work even connected to a Raspberry Pi :-D

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #108 on: 2016.April.01. 18:17:03 »
If someone would like to try ... I can test windows build only with wine on Linux, it seems to work there. The "usual" -entermice prefixed distribution URL is used :-)

The "only" problem is mapping to controller events. Ie modern controllers have even about a dozen of button ID, axes, even "hats". For software, they don't know what are those buttons, axes, etc for real, only "button 1" or "axis 3", and these IDs means totally different things on different pads/joysticks, or even on different operating systems (maybe version dependent too ...) and drivers! Thus, now only there is a single hard wired config which seems to work here on Linux and X-Box controller, but that's all. It can be tricky to try to find, which controller element does "UP" or "FIRE" :) In the future, I would need some calibration possibility, so user can set it in an interactive way, then Xep128 stores that (also with the "GUID" of the controller - that's an identifier for a given controller -, so it will now that different controller needs another calibration ...) and can re-use it later.

Currently, only one gamepad/joystick is recognized with the fixed mapping I've talked about. Now, the events are distributed for both of the external joysticks on the same time, and still, numeric keypad can override, and can be used as an "external joystick". I'm also thinking on the possibility to have option for using game controller/joystick to emulate the internal joystick, but as we know, it's a different issue, as that's part of the "main keyboard matrix".

A hint: in IS-BASIC you can enter this command ":XEP showkeys" (also on the console/monitor window, without the :XEP part then, only "showkeys"). It causes Xep128 will give visual feedback (via OSD) about every pressed key and joystick emulation event. Now button #0 and axes #0/#1 are used only. Issuing the mentioned command again caused to turn this "debug mode" off.

In theory, Xep128 supports hot-plug (add/remove) the USB controller (try plug pad in/out while Xep128 is running), and it will show via OSD about the event. Anyway, not so useful, as only one config is used with the joy #0 on the system only.

Interesting, that SDL has some support for the "haptic" stuffs (I have no idea about the meaning of this word to be honest, SDL names that way ...), ie to "rumble" the controller. I have no idea if it's useful for anything for an Enterprise emulator :)

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #109 on: 2016.April.01. 21:51:08 »
I can test some controllers, even analogue ones, only I have to search for them.

I have at hand one of this HID controllers to play with MAME old acade games. I can try this now. It is completely configurable, so may be I can mimic the Xbox pad settings. Let's see...

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #110 on: 2016.April.01. 22:57:56 »
It has worked at the very first time!

Even if it is set as an analogue joystick. The fire button is precisely the first of the  32 I can configure...

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #111 on: 2016.April.01. 23:04:38 »
It has worked at the very first time!

Even if it is set as an analogue joystick. The fire button is precisely the first of the  32 I can configure...

In SDL joystick interface at least, I always gets axis information as a 16 bit signed integer ... I tried to use some "clever algorithm" (not so much a big deal anyway, just I don't know the exact word for this in English) to avoid "bouncing" between values at a given limit, ie, the a higher level is needed to set joy direction to 1, but releasing the handle a lower limit needs to hit to fall back to zero. Currently, the high limit is 20000 and low is 10000. Of course the same at the "opposite" (negative) direction for a given axis.

You can see some values, if you enable that showkeys mode, I've mentioned though ...

Xep128 emulation allows three fire buttons btw ... Just it's not "configured" to do so :) Some configuration possibility is a must, ie, even allowing to use EP external joy 1-2 as two handled on the same pad, or from two different pads, etc, the joystick emulation abstraction layer in Xep128 (between the emulated EP and the SDL level functionality) would allow this ...

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #112 on: 2016.April.01. 23:25:08 »
It seems that SDL treats analogue and digital lecture the same. I don't have a pure digital Pc joystick now, I have to look for it, sorry.

But I figure that a digital joystick gives you X=+32767 when Right is pressed and X=-32768 if Left. The same on Up and Down. Of course Centre gives you 0.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #113 on: 2016.April.02. 00:04:33 »
It seems that SDL treats analogue and digital lecture the same. I don't have a pure digital Pc joystick now, I have to look for it, sorry.

But I figure that a digital joystick gives you X=+32767 when Right is pressed and X=-32768 if Left. The same on Up and Down. Of course Centre gives you 0.

Something like that, but I guess not exact values always, eg user can't push for +32767 totally or plastic case deformed, whatever :) The other issue with analogue stuff, that treating that as a digital (I need that, since EP use that ...) creates some odd "bounces" between phases near the limit, that's why I implemented the increasing limit and decreasing limit as a separated values, what I've already written about in one of my previous posts.

I have really no idea what digital joysticks behaves from the point view of SDL ... Even on the X-Box controller I borrowed there is that (well I am not a game expert, do not laugh ... a lot, at least) stuff, like a + sign. That it seems generates "hat" events, I don't know what is the correct notion. It seems it's another control type besides buttons, and axes. I don't support hats currently ... Hopefully a digital USB joy wouldn't behave as hat, or I should implement that too :) There is another control type left: "ball". Again, I have no idea what's that :) According to the documentation of SDL it gives relative X, Y motion info, so I guess it's something like a trackball, or whatever :) So, an upside-down mouse :D

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #114 on: 2016.April.02. 00:42:34 »
Yes, it is for a mouse or a trackball. You can have several mice connected to a PC, this is,  electronically they are individual, but stupid Windows treats all of them as the same. In MAME simulators you can have one mouse for every player of a game.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #115 on: 2016.April.02. 16:56:29 »
Ok, the new version supports "hats" as well. To be able to re-use code and decrease complexity, they are mapped as "virtual axes". But should work the same way. Now that's shame that Xep128 is hard-wired to use axes 0 and 1 for joy emu, so it does not help too much to have support :) Even without "calibration" (user friendly way) I need to implement a command line config option to set axis numbers for joy emu, at least :)

But at least with enabled SHOWKEYS mode (:XEP showkeys) you can see the events also with virtual Y/N info as well (Y for hats, mapped to axes after the "real" axes reported by the joystick/controller). It can be also useful if it turns out that true digital USB joysticks implements only "hats" ... As hats seem to be digital, indeed, only positions like up, upright, etc, no other info like with "axes".

And btw: it seems I like useless things :) Now there is haptic/rumble support as well :D On the first joy scan from EP software makes Xep128 to send a rumble event to the controller, if it does support it at least. Not so much useful, just I was curious :)
« Last Edit: 2016.April.02. 21:16:52 by lgb »

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #116 on: 2016.April.07. 17:03:28 »
http://xep128.lgb.hu/

Newer "official" build. There is even some ChangeLog link there.

I think, maybe the most interesting feature is the ep128emu-like FILE: support. That is, it's possible (only LOAD now!) to LOAD programs directly from the host OS. It can be useful when testing software, no need to write to SD image first, etc etc, but it can be loaded directly from Windows/Linux, or whatever the emulator runs on. In theory, it's even possible to include EXDOS.INI (I haven't tested yet!!) on the SD card image with commands like this:

Code: [Select]
XEP CD C:\users\xyz\ep-files
LOAD FILE:sysext1.xr
LOAD FILE:sysext2.xr

... then Xep128 will execute the CD XEP command (which selectes the directory the FILE: functionality uses, the parameter is a host OS - ie Windows - directory with drive letter etc), then tries to LOAD something from there. The CD stuff is needed as there is a limitation of EXOS file name length, would be surely too short with full "windows" path for LOAD ... Btw, the default directory for FILE: is the files sub-dir inside the preferences directory.

See the "ChangeLog" link at the page above for more details. Please note, that it seems Win32 API has some surprises, ie I guessed unistd-like file read/write functions are unbuffered etc compared to fread() and friends. Well, it seems not on Windows ... Without the O_BINARY flag, there were serious problems with "truncated" reads etc ;) Hopefully it's OK now, at least it works for me tested with wine on Linux.
« Last Edit: 2016.April.07. 18:02:35 by lgb »

Offline gflorez

  • EP addict
  • *
  • Posts: 3608
  • Country: es
    • Támogató Támogató
Re: Xep128
« Reply #117 on: 2016.April.07. 18:20:12 »
Thanks for the Skiplogo option!

I must try an try the EDCW extension and it is annoying mandatorily to press a button to start.

Soon a mouse-click has to be implemented to skip the logo.....

Also thanks for the host LOAD, CD, and DIR commands. They work great for me.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Xep128
« Reply #118 on: 2016.April.07. 18:37:16 »
My future plan with the whole stuff:

First, implement snapshot support. Eg even loading ep128emu snapshot. Though saving snapshot it's problematic, that it can't carry all the information, eg what ep128emu can't emulate (SD cartridge, mouse, ....). As far as I can see, the snapshot format is expandable ... (maybe then it cannot be loaded to ep128emu ...).

Second, "fastboot" option. Ie, if the configuration (ROMs, RAM size, etc) hasn't changed (and fastboot option is used), XEP ROM tries to load an already saved snapshot, or create one at XEP ROM init time. Thus, next time of starting emulator with the same config, it's possible to get to a working machine more quickly without waiting for EXOS memory test, SDext init, etc etc.

Then, a "load" option, which is implemented by XEP ROM again, to allow specify file to LOAD in the command line. Personally I would love to test my EP programs this way, almost no time lost, and my program loaded from the host OS file system directly ... Without need to wait for EXOS, writing to that to the SD card image first, typing to LOAD in the emulator, etc ...

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Xep128
« Reply #119 on: 2016.April.07. 18:53:36 »
As far as I can see, the snapshot format is expandable ... (maybe then it cannot be loaded to ep128emu ...).

ep128emu ignores unrecognized data blocks. The block types could be for example 0x584550XX, or anything that does not conflict with those that are already in use.