Enterprise Forever

:UK => Programming => Topic started by: gflorez on 2016.May.18. 20:06:30

Title: SWAP game now has EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game needs EnterMice option
Post by: geco on 2016.May.18. 20:21:42
This sounds good :)
Title: Re: SWAP game needs EnterMice option
Post by: Ep128 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! :-)
Title: Re: SWAP game needs EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game needs EnterMice option
Post by: Zozosoft 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.
Title: Re: SWAP game needs EnterMice option
Post by: geco 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.
Title: Re: SWAP game needs EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game needs EnterMice option
Post by: geco 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
Title: Re: SWAP game needs EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game needs EnterMice option
Post by: geco on 2016.May.24. 09:11:48
Good news :)
Title: Re: SWAP game needs EnterMice option
Post by: Ep128 on 2016.May.24. 23:47:52
Yes, yes... :-)
Title: Re: SWAP game needs EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game now has EnterMice option
Post by: gflorez on 2016.May.30. 16:19:26
FINAL VERSION!

Please check for errors. For example, I have not reached record writing screen.
Title: Re: SWAP game now has EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game now has EnterMice option
Post by: gflorez 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.
Title: Re: SWAP game now has EnterMice option
Post by: Zozosoft on 2016.May.31. 21:50:41
Great work!!!

If possible then I suggest some color adjustment for the final version. The two dark blue, two red, and two grey bricks looks very similar :oops:
Title: Re: SWAP game now has EnterMice option
Post by: gflorez on 2016.May.31. 22:58:28
Ok, but that will be geco's work, as I have been only centred on control parsing, without modifying nor understanding the inners of the game.

Other things that could be improved:

-Pass the two demos with joy1 fire or mouse button additionally to only Space.

-Music can be de-activated only inside game, and is difficult to click.

-If memory allows, more songs in game.

-A better sound for the second demo.

-One pixel wide more of the clickable zone between colour bricks can make the game more playable. Actually is tricky to situate the pointer on the spot.
Title: Re: SWAP game now has EnterMice option
Post by: gflorez on 2016.June.04. 15:59:47
Added to the list of games on EnterMice wiki.

http://wiki.enterpriseforever.com/index.php/EnterMice#List_of_mouse_compatible_programs_up_to_date
Title: Re: SWAP game now has EnterMice option
Post by: geco on 2016.June.18. 21:59:13
Please check the game if you find any problem, please report to me, if everything is fine, I will pack it as final version.
2 colours were modified:1 red became darker, 1 green brighter
The program loads under EXOS 2.0 also, originally it did not loaded, because SWAP overwrites character memory of EXOS, but it used always EXOS 2.1 address.
It can be loaded on any expanded machine F8-FB segments are not required anymore.
The program still uses all video RAM, and 1000h bytes (plus EXOS character memory) from FF segment, if EXOS boundary >1000h then the program works as the original, if EXOS boundary >0800h then 2nd demo part is skipped, if EXOS Boundary < 800h then 2nd part is skipped, and loading screen also.
Title: Re: SWAP game now has EnterMice option
Post by: gflorez on 2016.June.19. 00:24:16
I like it!

Only a trivial question: have you reached the records screen?

If so, do the mouse movement work there?


I enjoyed very much the game, but it needs some time to learn how to completely erase a board. I have done two, but with aid, so my score was not enough to reach the lowest record....
Title: Re: SWAP game now has EnterMice option
Post by: geco on 2016.June.19. 09:32:10
I like it!
Only a trivial question: have you reached the records screen?
If so, do the mouse movement work there?
No :oops: , I just played about 10 minutes with the game, and half of the board were cleared then I stopped, and reset the game. Until now I could not test mouse, today I will try to install XEP128 to linux :)
Title: Re: SWAP game now has EnterMice option
Post by: szipucsu on 2016.June.19. 10:26:43
Excuse me if it is a trivial question too. How can I try this game with the mouse on the PC? I always use EP128Emu. How can I load it to the XEP?
Title: Re: SWAP game now has EnterMice option
Post by: geco on 2016.June.19. 10:50:43
I could not try yet XEP, but if I remember well you should start it with FILEIO mode if I remember well XEP128 :FILE