Enterprise Forever

:UK => Programming => Topic started by: gflorez on 2016.June.01. 19:07:44

Title: Can EP128emu get EnterMice emulation?
Post by: gflorez on 2016.June.01. 19:07:44
Probably this is a silly question, if it could be done it would be already made, I guess....

I don't know a word of Lua, only that it serves to modify subtle aspects of the emulator, to put breakpoints  or write the memory.

But, can I use Lua to take the PC mouse data and parse it to the B6 Z80 port like LGB does inside his emulator?
Title: Re: Can EP128emu get EnterMice enmulation with a Lua script?
Post by: Zozosoft on 2016.June.01. 19:48:17
can I use Lua to take the PC mouse data
I think there is the problem :-(
Title: Re: Can EP128emu get EnterMice enmulation with a Lua script?
Post by: endi on 2016.June.01. 20:01:09
yes
I want to make mouse controlled basic games :)
Title: Re: Can EP128emu get EnterMice enmulation with a Lua script?
Post by: Zozosoft on 2016.June.01. 20:08:15
ep128emu sources are available.
Just needed someone who can do the further develop...
Title: Re: Can EP128emu get EnterMice enmulation with a Lua script?
Post by: gflorez on 2016.June.01. 21:07:42
yes
I want to make mouse controlled basic games :)

You can do it easily with XEP128 using this SD-image:

https://www.dropbox.com/s/gn6sj8165ytep22/sdcard.rar?dl=0

It autostarts in the EGI, with a wonderful mouse driver usable in Basic.....

I don't know if they are the latest versions, but you can download them from the EnterMice wiki.

You can transfer your Basic programs to the image with Winimage.
Title: Re: Can EP128emu get EnterMice enmulation with a Lua script?
Post by: gflorez on 2016.June.01. 21:11:57
ep128emu sources are available.
Just needed someone who can do the further develop...

It is a hard work for me... I only understand a little of C, and this is C++. But I can put an eye on the controllers part.
Title: Re: Can EP128emu get EnterMice emulation?
Post by: gflorez on 2016.June.03. 08:01:03
The definition of port B6 is inside "dave.cpp", because from the emulator point of view it is a Dave port.

Write port B5:

    keyboardRow = int(value & 0x0F);
    tape_feedback = int(!(value & 0x20));     // tape control
    setRemote1State(value & 0x40 ? 1 : 0);
    setRemote2State(value & 0x80 ? 1 : 0);

Read port B6:

      {
        uint8_t n = 0x01;
        if (keyboardRow < 5) {
          // external joystick 1 (mapped to keyboard row 14)
          n = uint8_t((unsigned int) keyboardState[14] >> (4 - keyboardRow));
        }
        else if (keyboardRow < 10) {
          // external joystick 2 (mapped to keyboard row 15)
          n = uint8_t((unsigned int) keyboardState[15] >> (9 - keyboardRow));
        }
        // tape input
        n = uint8_t((n & 0x01) | 0x0E | ((tape_input_level - 1) & 0x40)
                    | ((tape_input - 1) & 0x80));
        return n;
      }

Writing to B7 port(RTS) is not defined.