Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:26 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : HexParty Puzzle for CMM2

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 05:31pm 19 May 2024
Copy link to clipboard 
Print this post

New puzzle program for the CMM2: requires a mouse, sorry.

The goal is to load the given partition segments into the hexagonal playing board until the board is completely covered with no gaps or overlaps. There are 60 supplied puzzles in small, medium, and large sizes. Plus, there is a program that you can use to make your own devilish puzzles!




Enjoy!
-Bill


HexParty.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 06:15pm 19 May 2024
Copy link to clipboard 
Print this post

Nice! Will try few games this week.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:23pm 28 May 2024
Copy link to clipboard 
Print this post

Hi Bill,

Have not been able to run the game.
I have a PS2 mouse, so I changed variable MCHAN from 2 to 0.
It does not give an error on opening the mouse, so I assume the mouse channel is open now.

But now the game errors at line 224

gui cursor mouse(X),mouse(Y)


with "Error in line 224: Not open".

According to the CMM2 user manual there is a separate manual for the CMM2 on "GUI programming", but that is not on Geoff's website. So I am stuck here....

No idea what to do.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 09:39pm 28 May 2024
Copy link to clipboard 
Print this post

Read the user manual entry for the mouse function, 2nd variant

Nothing to do with the GUI manual
Edited 2024-05-29 07:39 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:03pm 29 May 2024
Copy link to clipboard 
Print this post



Volhout
PicomiteVGA PETSCII ROBOTS
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 09:38pm 02 Jun 2024
Copy link to clipboard 
Print this post

Just a reminder, I run a Gen 2 CMM2 that has a USB mouse port, so when I write programs that use a mouse, I use the USB mouse version of the mouse initialization on channel 2 (MCHAN constant in my programs). If your mouse is one of the PS2 rodents, you will have to change the syntax to match that.

All of my mouse-based programs use exactly the same code to manage the mouse:

sub InitMouse -- opens the mouse, defines a left-click ISR (and sometimes a right-click ISR also), enables a cursor with the gui command, starts a timer to update the cursor to the current mouse position.

sub LeftClick -- left-click ISR. Checks the lbusy global to see if processing for the previous click is complete, sets the lclick global to 1, saves the mouse coordinates.

sub UpdateCursor -- called every 20 msec by the timer, sets the cursor to current mouse coordinates.

-Bill
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 09:45pm 02 Jun 2024
Copy link to clipboard 
Print this post

  Quote  I use the USB mouse version of the mouse initialization on channel 2 (MCHAN constant in my programs).


If you include mchan in the mouse function calls as well as the open then your programs will work for any mouse connection. This will be benign for the USB mouse.
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 12:41am 03 Jun 2024
Copy link to clipboard 
Print this post

Peter says,

  Quote  If you include mchan in the mouse function calls as well as the open then your programs will work for any mouse connection. This will be benign for the USB mouse.


Oh, but I do: always.
-Bill
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:06am 03 Jun 2024
Copy link to clipboard 
Print this post

  Quote  Oh, but I do: always.


Sorry if I misinterpreted but I was going on this from Volhout

  Quote  But now the game errors at line 224

gui cursor mouse(X),mouse(Y)



where the line would be better as:

gui cursor mouse(X, mchan),mouse(Y, mchan)
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 01:31pm 03 Jun 2024
Copy link to clipboard 
Print this post

Ah, ok. It's true, I have not been adding the channel argument to the mouse() functions such as mouse(X), etc.

-Bill
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 01:53pm 03 Jun 2024
Copy link to clipboard 
Print this post

Hi Bill,

The channel argument is optional for I2C mice, but for PS2 mouse it is mandatory.
Thank you for the game (I alreay made the change in my version, otherwise it would not run).

Volhout

P.S. I will not port this game the PicoMite since the high resolution color screen is essential for the game play (to give overview). PicoMite 640x480 might do it, but the tiles are square, and will not line up nicely with the hex pattern. And 320x240 resolution looks inadequate.
PicomiteVGA PETSCII ROBOTS
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 12:36pm 04 Jun 2024
Copy link to clipboard 
Print this post

Volhout said:
  Quote  P.S. I will not port this game the PicoMite since the high resolution color screen is essential for the game play (to give overview). PicoMite 640x480 might do it, but the tiles are square, and will not line up nicely with the hex pattern. And 320x240 resolution looks inadequate.


Yes, definitely. I keep slaving away writing stuff for the CMM2 largely because of its excellent graphics capabilities. This also explains why I don't play with the picomite much, although I did build one and it works.

Lately I have been exploring mode 10 to get even more pixels on the screen. Here's a screen shot from a program I just finished. (I don't know if TheBackShed is going to reduce the size you see, but it's full size in mode 10.)



-Bill
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024