Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:10 01 Aug 2025 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 : Luner lander dirctionals inverted with new firmwares.

Author Message
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 490
Posted: 07:52pm 20 Sep 2020
Copy link to clipboard 
Print this post

I just updated to 5.5.6.B9 (almost 5 MINUTES before the B10 was released, DAMN) now Luner Lander from the welcome tap and the version with Numbchuck support have trust  directions and rotation is inverted as well.  You use trust and it goes in the other direction and you rotate L or R and it goes the other way.  Anyone know what the hell happened there? It does the same thing with keys or the numbchuck.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 08:29pm 20 Sep 2020
Copy link to clipboard 
Print this post

Wow, just tested LunarLander version 72 on firmware 5.05.06b10 and the flipped controls really make it hard.

I think the problem is the IMAGE ROTATE command somewhere around line 100.

But I can't test yet because the watch dog timer just erased the program on the SD card...  
Visit Vegipete's *Mite Library for cool programs.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 08:39pm 20 Sep 2020
Copy link to clipboard 
Print this post

  vegipete said  But I can't test yet because the watch dog timer just erased the program on the SD card...  


Was this on exiting / running / saving from the Editor ?
Did it delete the file, or truncate it to size 0 ?
What OPTION SD TIMING are you using ?

Sounds like it might be what I reported to Peter earlier in the day https://www.thebackshed.com/forum/ViewTopic.php?TID=12696&P=6#155213

This very occasional bug predates the watchdog timer, it used to delete the file and then hang.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 08:53pm 20 Sep 2020
Copy link to clipboard 
Print this post

I just reported more about the 'event' (twice, actually) on the '06 beta thread. F2 to save and run. The file still exists, just its size is zero. I kinda suspect my SD card is part of the problem. Using the default SD timing, which I gather is slower.

With regards LunarLander, the last parameter of both IMAGE ROTATE commands must be made negative to fix the game. (Change "i*5" to "-i*5")
Growl! How do you fix that so that the game works for people with older or newer firmware?
Visit Vegipete's *Mite Library for cool programs.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 10:58pm 20 Sep 2020
Copy link to clipboard 
Print this post

  vegipete said  How do you fix that so that the game works for people with older or newer firmware?

You can test the firmware version.

John
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 12:22am 21 Sep 2020
Copy link to clipboard 
Print this post

I don't think you can test specific beta versions.

I think it 'broke' with the second release of V5.05.06b6. (2020/Sep/18/01:50am posting)

A test involves drawing a pixel, rotating it 90 degrees around another point, and then looking for where the pixel went.

When all the dust settles, LunarLander will work as is for firmware release version up to and including 5.05.05 and will need a change for release version 5.05.06 and onward.

===========
I think this works:
mode 1,8  ' ensure 8 bit colour mode
cls
pixel 0,1  ' draw one white pixel, left edge middle of a 3x3 region
image rotate 0,0,3,3,0,0,90
if peek(byte mm.info(page address 0) + 1) = 255 then  ' test for pixel top center
 <clockwise rotation>
else
 <counterclockwise rotation>
endif

That's a gnarly bit of code to identify beta 6 or higher but how else do you ensure LunarLander works for all?

Edit: I should add, <clockwise rotation> indicates beta 6 or higher.

To fix LunarLander, the following should be added/changed:  (untested)
 PAGE WRITE 2
 CLS
 PIXEL 0,1  ' draw one white pixel, left edge middle of a 3x3 region
 IMAGE ROTATE 0,0,3,3,0,0,90
 IF PEEK(byte mm.info(page address 2) + 1) = 255 THEN ' test for pixel top center
   rotfactor = -1
 ELSE
   rotfactor = 1
 ENDIF
 CLS
 LOAD PNG "LanderPict.png"

 ' generate the rotations
 FOR i = 1 TO 18
   IMAGE ROTATE 0, 0,40,40,i*40, 0,i*5*rotfactor
   IMAGE ROTATE 0,40,40,40,i*40,40,i*5*rotfactor
 NEXT i

Edited 2020-09-21 10:33 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 09:30pm 28 Oct 2020
Copy link to clipboard 
Print this post

@vegipete Sorry to resurrect this thread, but 5.05.06RC7 is giving me new grief with Lunar Lander and I was hoping you would be generous enough to confirm what I am seeing and run down the problem ? ... though I think it might ultimately be something for Peter.

1. Install Welcome Tape if not already present.
2. Reset CMM2
3. chdir "welcome/lunar"
   - or "welcome/games/lunar" if you happen to have the unreleased Welcome Tape 0.5 installed
4. *lunar
5. Game runs fine
6. Quit
7. EDIT "lunar.bas"
8. F2
9. Controls are reversed and the lander sprite is not correctly filled when rotated.
10. Quit
11. *lunar
12. Controls are reversed and the lander sprite is not correctly filled when rotated.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 10:49pm 28 Oct 2020
Copy link to clipboard 
Print this post

I can't confirm crazy rotation effects, but I didn't really try. Repeated "RUN" from the prompt seemed to work fine.

I did notice a different problem - the rotated images are gray instead of white. Something else changed in the IMAGE ROTATE command. I chased this back to the change from version 5.05.04 and 5.05.05

I've attached my solution to all this confusion. I reflashed version 5.05.04, generated the correct rotated sprite images, saved them ALL, made a new sprite sheet with ALL images pre-generated, and updated LunarLander appropriately.

Back to version 5.05.06RC7 and it seems to work fine from the prompt.

You'll have to work your magic to integrate it with the welcome tape.
LunarLander ends on line 335, to make your modifications easier.

LunarLander2v73 with pre-generated sprites

Please test and let me know.
Edited 2020-10-29 09:19 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:10am 29 Oct 2020
Copy link to clipboard 
Print this post

Thanks Pete, that seems to fix the rotation bug. I still think there is something subtly and inexplicably different in the sprite colour between a "RUN" from the prompt and an "F2" from the EDITor ... though I'm also beginning to suspect my sanity

I'm going to go with "it's good enough" on the assumption that if there is a firmware issue it will pop up again and Peter can be imposed upon to look at it.

Note that for the purposes of the Welcome Tape this is actually "Lunar Lander v7.4" as a "v7.3" was included on the Welcome Tape v0.4.

Thanks for your help,

Tom
Edited 2020-10-29 20:41 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 12:35pm 29 Oct 2020
Copy link to clipboard 
Print this post

  Quote   I still think there is something subtly and inexplicably different in the sprite colour between a "RUN" from the prompt and an "F2" from the EDITor ... though I'm also beginning to suspect my sanity


There is something but I'm struggling to find it. Does the program in question use any GOSUBs?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:12pm 29 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  There is something but I'm struggling to find it. Does the program in question use any GOSUBs?


Sorry Peter, no GOSUBs.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 01:29pm 29 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Sorry Peter, no GOSUBs.


In which case I'm not aware of any issues and anything you are seeing is not what I was chasing so would need you to investigate further. There is a nasty bug in GOSUB I've just found and fixed that manifests when the program is run from the command line, but only the first time.

I've also fixed the TTS bug (applies to FLAC and WAV as well). Will be in RC8.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 01:46pm 29 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  In which case I'm not aware of any issues and anything you are seeing is not what I was chasing so would need you to investigate further. There is a nasty bug in GOSUB I've just found and fixed that manifests when the program is run from the command line, but only the first time.

I've also fixed the TTS bug (applies to FLAC and WAV as well). Will be in RC8.


Thanks Peter, I'll take another look for this "bug" if I get a chance, but for the moment it isn't even close to being a show-stopper, just a minor irritation.

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:21pm 29 Oct 2020
Copy link to clipboard 
Print this post

OK Peter, here is a reduced example, I guess reproducing CMM2 firmware bugs is more interesting than the day job.

lunar.zip

1. Reset CMM2
2. RUN "lunar.bas"
3. Output is:

4. EDIT "lunar.bas"
5. F2
6. Output is:


Not only is the rotation "wrong", but the colours of the sprites are slightly different too.

And before you say anything it's @vegipete's weird code, not mine , and either way I would expect it to be weird and consistent, not weird and inconsistent.

Tom
Edited 2020-10-30 00:24 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 03:13pm 29 Oct 2020
Copy link to clipboard 
Print this post

OK Peter, here is a reduced example,

Perfect: found and fixed
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025