Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : MMBasic: Knightmare Game

   Page 2 of 10    
Posted: 08:58pm
09 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


Thank you Tom and Bill

Bill, I'll take a look at the errors on the MMB4W. I will keep the adjustments for the CMM2 to the end of the project. The black boxes are a weird problem because I'm using the screen mode that supports alpha, and pages 0 and 1 will "blend" considering the transparent pixels, what is happening on the MMB4W.

I'm adding power-ups and delta time to the game this weekend. The delta time is to keep the game speed consistent across different platforms. I will try to fix the buffer issues you have reported.

I'm also considering implementing support for gamepads. I need to buy one first. What gamepads do you recommend?
 
Posted: 10:38pm
09 Dec 2023
Copy link to clipboard
Turbo46
Guru


I've had no experience with gamepads other than the Wired Classic Controller Pro like this one which is supported by Tom's Lazer Cycle and will plug into the CMM2 front panel. It worked well for me.

Bill

PS. "FITHUB"   I didn't notice that until I read it just now.
 
Posted: 10:57pm
09 Dec 2023
Copy link to clipboard
Mixtel90
Guru


The wired Classic is supported by the PicoMite too now. :)

Tom's a champion of the NES/SNES controllers too, which are easy to read.
 
Posted: 11:27pm
09 Dec 2023
Copy link to clipboard
Turbo46
Guru


  Mixtel90 said  Tom's a champion of the NES/SNES controllers too, which are easy to read.

True: The CMM2 and MMB4W both need an interface for these and others but I don't want to hijack this thread.

Bill
 
Posted: 11:43pm
09 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


I found this super cheap one on Amazon, is it work?

https://www.amazon.ca/Nintendo-Controller-kiwitat%C3%A1-Joystick-Raspberry/dp/B01JYGYAX8/ref=sr_1_3?crid=2X4V5DJ5QHJT9
Edited 2023-12-10 09:43 by LeoNicolas
 
Posted: 11:49pm
09 Dec 2023
Copy link to clipboard
Turbo46
Guru


Sorry, I had no idea.

Bill
 
Posted: 12:24am
10 Dec 2023
Copy link to clipboard
vegipete
Guru


  LeoNicolas said  I found this super cheap one on Amazon, is it work?

https://www.amazon.ca/Nintendo-Controller-kiwitat%C3%A1-Joystick-Raspberry/dp/B01JYGYAX8/ref=sr_1_3?crid=2X4V5DJ5QHJT9

I'd say no way, those are USB devices.

It needs to have the funky Wii connector, that sort of square thing that fits the circuit board jack.
 
Posted: 08:53am
10 Dec 2023
Copy link to clipboard
Mixtel90
Guru


Unfortunately, at the moment there is no standard connector shared between the PicoMite boards, the CMM2 and the PC. The closest we get is the keyboard. I'm working on that, with a PicoMite board that will accept the WII Classic and other I2C controllers. There were adapters that will connect the Wii Classic to a PC too (Like this, but out of stock) . There was also the Elecom adapter but that seems to be unavailable now.
Edited 2023-12-10 19:09 by Mixtel90
 
Posted: 09:26am
10 Dec 2023
Copy link to clipboard
matherp
Guru

  Quote  The black boxes are a weird problem because I'm using the screen mode that supports alpha, and pages 0 and 1 will "blend" considering the transparent pixels,


Transparent pixels must be RGB(0,0,0,0) and not rgb(BLACK) = rgb(&HFF,0,0,0)
The best way to load a sprite is from a png file. If you view a suitable png file the background will be a grey checkerboard and not black


 
Posted: 12:16pm
10 Dec 2023
Copy link to clipboard
thwill
Guru


Hi Leo,

I'm worried the state of controllers has not been made completely clear:

1. MMB4W has NO controller support. Hence Bill having started this thread https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=16491#213846. Though, I hope my friend Bill will forgive me, this is the sort of "craziness" that hardware engineers come up with when unsupervised . In theory the OneLoneCoder library that Peter used for MMB4W has functions for (USB?) controller support (or at least it is available as a plugin), but that requires someone with both inclination and time on their hands to upgrade MMB4W.

2. The CMM2 (and now PicoMite) has support for Wii Classic Controllers with the "nunchuck" connector, like this one: https://www.amazon.co.uk/gp/product/B07H9BKG1G

3. The CMM2 and PicoMite cannot use any USB controllers, e.g. those "SNES" ones that you posted a link to, which aren't SNES at all, except cosmetically.

Best wishes,

Tom
Edited 2023-12-11 01:11 by thwill
 
Posted: 09:38pm
10 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


  matherp said  
Transparent pixels must be RGB(0,0,0,0) and not rgb(BLACK) = rgb(&HFF,0,0,0)
The best way to load a sprite is from a png file. If you view a suitable png file the background will be a grey checkerboard and not black


Yes, it is what I'm doing. On GIMP I'm exporting the image as PNG 8bpc RGBA.

This is the PNG from the project repo:
https://github.com/leonicolas/knightmare-cmm2/blob/main/tiles/objects.png


Edited 2023-12-11 07:41 by LeoNicolas
 
Posted: 11:37pm
10 Dec 2023
Copy link to clipboard
JohnS
Guru

When I view that it doesn't look to have a checkerboard background.

That's in firefox - is that the wrong way to view?

John
Edited 2023-12-11 09:38 by JohnS
 
Posted: 11:59pm
10 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


The browser does not show the pattern, it shows the background under the image. The square pattern is rendered by some softwares to show the image transparent areas. You can download the PNG and open it on Gimp. Gimp uses the square pattern
 
Posted: 12:55am
11 Dec 2023
Copy link to clipboard
lizby
Guru

Ok, got it:

 
Posted: 10:28am
11 Dec 2023
Copy link to clipboard
matherp
Guru

If you load the complete image as a sprite does that show as expected? How are you breaking up the image into individual sprites?
 
Posted: 05:06pm
11 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


  matherp said  If you load the complete image as a sprite does that show as expected? How are you breaking up the image into individual sprites?


I'm doing something wrong for sure

I'm also having artifacts sometimes when I'm hiding and showing sprites. The following image shows an example of when I'm hiding the sprite over the block that shows the block content (the gray block is the background and is overlayed by a sprite showing the question mark or the block content). This problem happens when the shield is over the block, and I'm hiding the block sprite. I will probably need to create a simpler code reproducing the artifacts problem to help you.



These are the steps I'm using for creating sprites:

1) I'm loading the PNGs into different pages when the game starts using:


page write MAP_TILES_BUFFER: load png "MAP_TILESET_IMG"
page write OBJ_TILES_BUFFER: load png "OBJ_TILESET_IMG"
...


Where:


const SCREEN_BUFFER=2                     ' Screen buffer number
const MAP_TILES_BUFFER=3                  ' Map tileset buffer number
const OBJ_TILES_BUFFER=4                  ' Objects tileset buffer number
const BOSSES_TILES_BUFFER=5               ' Bosses tileset buffer number
const GENERAL_USE_BUFFER=6                ' General use buffer number


2) In the main loop, I'm drawing the map tiles in the SCREEN_BUFFER and also scrolling the background

3) I'm spawning new sprites when necessary in the SCREEN_BUFFER using:


sprite read sprite_id%, OBJ_TILE%(obj_id%,0)+offset_x%, OBJ_TILE%(obj_id%,1)+offset_y%, OBJ_TILE%(obj_id%,2), OBJ_TILE%(obj_id%,3), OBJ_TILES_BUFFER
sprite show safe sprite_id%, g_obj(i%,1),g_obj(i%,2), layer%


Where OBJ_TILE contains the coordinates of the image in the PNG to be used by the sprite.

4) I'm moving the sprites using sprite next and sprite move

5) I'm copying the SCREEN_BUFFER page to the page 0 using:


page write 0
blit 0,TILE_SIZEx2, SCREEN_OFFSET,0, SCREEN_WIDTH,SCREEN_HEIGHT, SCREEN_BUFFER
page write SCREEN_BUFFER

Edited 2023-12-12 03:11 by LeoNicolas
 
Posted: 06:11am
14 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


  matherp said  If you load the complete image as a sprite does that show as expected? How are you breaking up the image into individual sprites?


Matherp, I have found and fixed the issue that was causing artifacts when collecting the bonus blocks  

I also partially implemented the power-ups. I will release a new version with full power-ups on the weekend.

The following video has a glimpse of the new power-up implementation

https://youtu.be/PCZzFoVUj44
 
Posted: 08:30am
14 Dec 2023
Copy link to clipboard
Volhout
Guru

Hi LeoNicolas,

This is looking so good !!! Wauw.

Volhout
 
Posted: 04:14pm
14 Dec 2023
Copy link to clipboard
LeoNicolas
Guru


Does anyone have the experience and time to help me migrate VGM audio to MOD?

I can provide the VGM files that can be opened on FamiStudio, which provides the song notes and effects from the two used audio channels. Unfortunately, FamiStudio doesn't support exporting MOD files.

The following image exemplifies the Knightmare stage 1 song in FamiStudio.


 
Posted: 07:02pm
14 Dec 2023
Copy link to clipboard
Martin H.
Guru


https://www.thebackshed.com/forum/ViewTopic.php?TID=16416&P=1#212599
 
   Page 2 of 10    
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025