Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:13 17 Aug 2026 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 : PicoMite - Attractor Mode

Author Message
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 443
Posted: 11:13am 15 Aug 2026
Copy link to clipboard 
Print this post

Here we go ...

Not a heavy GitHub user, but it works:

PicoMite Attractor

Currently only Missile Command in there as I need to clean up my trashy code and add comments.

This plays against itself, so no actual user control.  If anyone want to refactor and add that, go for it.

The autoload part is in there, but in the upload it forces just missile.bas to reload - should be obvious where this is.

Also, no sound.

Used a ST7735S_W - but should work on anything 128x128 - but didnt code anything to cope with different screens as this is what I have ;-)

G
Entropy is not what it used to be
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 443
Posted: 05:37pm 15 Aug 2026
Copy link to clipboard 
Print this post

Missile Command
Asteroids

AI used to comment the code as I generally skimp on that.
AI also used to get the frame rate up -- it suggested / implemented:

1 - scaling the graphics by x16 and then downsizing (to use Ints)
2 - not using trig but a lookup table
3 - use of Framebuffer on Asteroids for the background BUT drawing the user ship straight on the LCD bypassing the framebuffer - sort of hybrid.
4 - collision detected tweak by AI (still not sure it's 100%)

G
Entropy is not what it used to be
 
Bleep

Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 838
Posted: 05:48pm 15 Aug 2026
Copy link to clipboard 
Print this post

Hi Nimue,

I am surprised that 1 & 2 made it faster, I have usually found there is almost no difference using Ints, especially if you then have to rescale;  when I, and I think Peter, tried using lookup tables, to speed up Bubble Universe  for trig, it was slower?
I do use Int where it's easy loop counts, maths that doesn't require the precision etc.
Have you tried implementing each item and then timing individually.
Regards.
Edited 2026-08-16 03:52 by Bleep
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 443
Posted: 06:00pm 15 Aug 2026
Copy link to clipboard 
Print this post

  Bleep said  Hi Nimue,

I am surprised that 1 & 2 made it faster, I have usually found there is almost no difference using Ints, especially if you then have to rescale;  when I, and I think Peter, tried using lookup tables, to speed up Bubble Universe  for trig, it was slower?
I do use Int where it's easy loop counts, maths that doesn't require the precision etc.
Have you tried implementing each item and then timing individually.
Regards.


Honest answer - no.

Just by inspection of the game on the screen.  I was happy with the percieved frame rate.

I implemented them Int first, then look up.

Moving to INTs seems to make a visible difference - so I left it.  The look up - not so much as obvious, but I still left it as it didnt break anything.

This raises the "AI" question again, where I was happy to delegate some of the thinking as this was for "fun" and not mission critical -- but I didnt test for sure, so dont have numbers.

I'm working on Space Invaders that AI has done all the heavy lifting after I uploaded the MMBasic Manual - my Missile Command prog and told it what LCD panel it was using.

One prompt and a runnable version stright to the 'Mite.

Lots of tweaking still to do, but it worked first time with my working example to lean on.

Colour me impressed.
Entropy is not what it used to be
 
mozzie
Guru

Joined: 15/06/2020
Location: Australia
Posts: 418
Posted: 07:35am 16 Aug 2026
Copy link to clipboard 
Print this post

G'day Nimue,
Very nice job on this project, self playing games are a great idea  

Downloaded your code from GITHUB and tried out on LCD and it looks neat  
After making a few adjustments to try on HDMI (1024x600 Mode2 = 256x150) the following caused an error:

Dim lnew
Dim newload As Integer
Dim attract$ As String

SetTick 180000, lnew

newload = 0

Sub lnew
   Select Case 2 'Int(Rnd * 4) + 1
       Case 1
           attract$ = "defender.bas"
       Case 2
           attract$ = "asteroids2.bas"
       Case 3
           attract$ = "lander.bas"
       Case 4
           attract$ = "missile.bas"
   End Select
   newload = 1
End Sub


Having LNEW as a variable and a subroutine name should not be possible, this might be causing some problems  
Oddly it works on the LCD version but errors on the HDMI version  

Regards, Lyle.
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 443
Posted: 10:26am 16 Aug 2026
Copy link to clipboard 
Print this post

  mozzie said  G'day Nimue,
Very nice job on this project, self playing games are a great idea  

Having LNEW as a variable and a subroutine name should not be possible, this might be causing some problems  
Oddly it works on the LCD version but errors on the HDMI version  

Regards, Lyle.


That's odd - the error is probably mine.

Dim Lnew as used as Sub as have Option Explicit.   Do I not need to do that and just define the sub and call it?  Its not a variable - just the sub name.

Getting in a bit of a knot I think (me that is ;-))

G
Entropy is not what it used to be
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 9036
Posted: 10:41am 16 Aug 2026
Copy link to clipboard 
Print this post

You should only DIM variables, not Sub names. Strange that it works at all. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Nimue

Guru

Joined: 06/08/2020
Location: United Kingdom
Posts: 443
Posted: 11:33am 16 Aug 2026
Copy link to clipboard 
Print this post

  Mixtel90 said  You should only DIM variables, not Sub names. Strange that it works at all. :)


Yup - fixed / removed.

Not very good at maintaining code, I think at somepoint lnew was going to be a variable with an IF check and it just got left behind.

Thanks
G
Entropy is not what it used to be
 
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 2026