Welcome, Guest. Please login or register.


Author Topic: SWAP game now has EnterMice option (Read 5612 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
SWAP game now has EnterMice option
« on: 2016.May.18. 20:06:30 »
Thanks to geco for de-packing the game. Now I am studying the possibilities.

Until now I have found:


There is plenty of space to put the additional code, at least 1,3kb, that I can paste expanding SWP.PR8 at the end of the file.

The coordinates are managed on the two modes, both absolute pixels X,Y, and its correspondent memory address.

Only the internal joystick is parsed mandatorily, if no movement is found, then joy 1 is parsed.
« Last Edit: 2016.May.30. 16:20:06 by gflorez »

Offline geco

  • EP addict
  • *
  • Posts: 7085
  • Country: hu
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #1 on: 2016.May.18. 20:21:42 »
This sounds good :)

Offline Ep128

  • EP addict
  • *
  • Posts: 1849
  • Country: hu
    • Honlapom
Re: SWAP game needs EnterMice option
« Reply #2 on: 2016.May.18. 21:28:57 »
Thanks to geco for de-packing the game. Now I am studying the possibilities.

Until now I have found:

There is plenty of space to put the additional code, at least 1,3kb, that I can paste expanding SWP.PR8 at the end of the file.

The coordinates are managed on the two modes, both absolute pixels X,Y, and its correspondent memory address.

Only the internal joystick is parsed mandatorily, if no movement is found joy 1 is parsed.

This appears good to starting basis! :-)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #3 on: 2016.May.22. 02:10:28 »
Modifying the loader I've linked my MSX routine and "poked" a jump in the main code to it.

Now the joystick is parsed inside the MSX routine.


If I call both the keyboard and mouse parsing code, the game doesn't hang, only that the music plays very slow to understand it.

Calling the keyboard now it sounds to me a little faster than before.

With only the mouse call, the music is slowed a little, but not to sound completely bad. Raspy is the word.
 


I think I must put some form of selection for the controller.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: SWAP game needs EnterMice option
« Reply #4 on: 2016.May.22. 18:54:22 »
One idea: combine the music routine with the mouse routine.
Send out some musci data, read one mouse byte, send some music, read next mouse byte, etc

If the game play MBM/DTM music, then IstvanV/Geco have a player source (new, updated), which can be used.

Offline geco

  • EP addict
  • *
  • Posts: 7085
  • Country: hu
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #5 on: 2016.May.22. 19:12:56 »
Swap plays the digi from interrupt :) But something could be inserted instead of wait step, if Gflorez finish the mouse implementation I will try to make the program EXOS compatible, and I could check then if something could be moved there.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #6 on: 2016.May.22. 20:06:58 »
I'm not so skilled.....

I will do a working version and then you could tweak the music side what you like.

Offline geco

  • EP addict
  • *
  • Posts: 7085
  • Country: hu
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #7 on: 2016.May.22. 20:10:18 »
I'm not so skilled.....

I will do a working version and then you could tweak the music side what you like.
Me neither skilled, just we have a good debugger :) If I write a small code, I spend a lot of time to debug, and find my mistake :D

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #8 on: 2016.May.24. 01:45:11 »
I think it can work at the end without touching the music. Reading the mouse routine takes longer than reading internal and joy1, but it can be compensated with a faster and direct pointer position calculation. I still have to work it out.

There is also a little of spare time on the acceleration that occurs when the same direction is repeated more than 40 frames. Then the movement is repeated twice. Simple directions are executed two times, but diagonals  are composed of two directions so, four directions are executed every time.

On the mouse mode this will be unnecessary.

Offline geco

  • EP addict
  • *
  • Posts: 7085
  • Country: hu
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #9 on: 2016.May.24. 09:11:48 »
Good news :)

Offline Ep128

  • EP addict
  • *
  • Posts: 1849
  • Country: hu
    • Honlapom
Re: SWAP game needs EnterMice option
« Reply #10 on: 2016.May.24. 23:47:52 »
Yes, yes... :-)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game needs EnterMice option
« Reply #11 on: 2016.May.30. 02:13:28 »
Here you have a teaser of the EnterMice adaptation for the SWAP game.

It seems to work, except the EXIT and music off buttons, that hang the game. To fix this will take me a little more time.

Inside the packet you have two executables, SWP.COM, the original game just as geco decrypted it, and SWP2.COM, my work-in-process. This is a modified loader that adds to the program the mouse code, contained on SWP.PR9.

Also I've included a more or less accurate disassembly, SWP.ASM, and the sources of my modifications, SWP2.SRC and SWP.PR9.SRC.
« Last Edit: 2016.May.30. 16:27:20 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game now has EnterMice option
« Reply #12 on: 2016.May.30. 16:19:26 »
FINAL VERSION!

Please check for errors. For example, I have not reached record writing screen.
« Last Edit: 2016.May.31. 08:47:34 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game now has EnterMice option
« Reply #13 on: 2016.May.31. 08:46:57 »
Seems that the EXIT button worked on the XEP128 emulator but was still not recognised on the real EP+EnterMice.

The check routine for the button on the SWAP program was looping excessively close-short, so resetting and setting RTS didn't work because the cycles where too fast for EnteMice to recognise them.

I have added a byte counter(255 cycles) and  now it works.
« Last Edit: 2016.May.31. 12:16:32 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: SWAP game now has EnterMice option
« Reply #14 on: 2016.May.31. 12:15:54 »
Sorry... another fix.  Mouse button needs debouncing on some selections. I don't know why Int or Joy1 don't need it. The same situation happened on EDCW.




Edit: SWAP loads and works perfectly on XEP128, but delays considerably creating the blue 3D text scroll on the first demo.
« Last Edit: 2016.May.31. 13:53:34 by gflorez »