ENTERPRISE KLUB
2019. május 25., 1055 Budapest, Nyugati tér 9. 14-19 óráig
Részletek
Welcome, Guest. Please login or register.


Author Topic: Can EP128emu get EnterMice emulation? (Read 818 times)

Online gflorez

  • EP addict
  • *
  • Posts: 2559
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
Can EP128emu get EnterMice emulation?
« 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?
« Last Edit: 2016.June.03. 00:32:54 by gflorez »

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Can EP128emu get EnterMice enmulation with a Lua script?
« Reply #1 on: 2016.June.01. 19:48:17 »
can I use Lua to take the PC mouse data
I think there is the problem :-(

Offline endi

  • EP addict
  • *
  • Posts: 7009
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 50.0.2661.94 Chrome 50.0.2661.94
    • View Profile
    • Honlapom
Re: Can EP128emu get EnterMice enmulation with a Lua script?
« Reply #2 on: 2016.June.01. 20:01:09 »
yes
I want to make mouse controlled basic games :)
A diplomás magyar programozó megcsinált egy pacmant egy év alatt, majd lefikázta a világ legjobb játékait. :D

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Can EP128emu get EnterMice enmulation with a Lua script?
« Reply #3 on: 2016.June.01. 20:08:15 »
ep128emu sources are available.
Just needed someone who can do the further develop...

Online gflorez

  • EP addict
  • *
  • Posts: 2559
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
Re: Can EP128emu get EnterMice enmulation with a Lua script?
« Reply #4 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.
« Last Edit: 2016.June.02. 10:16:31 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2559
  • Country: es
  • OS:
  • Unknown Unknown
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
Re: Can EP128emu get EnterMice enmulation with a Lua script?
« Reply #5 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.

Online gflorez

  • EP addict
  • *
  • Posts: 2559
  • Country: es
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 46.0 Firefox 46.0
    • View Profile
Re: Can EP128emu get EnterMice emulation?
« Reply #6 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.
« Last Edit: 2016.June.03. 09:43:43 by gflorez »