Hi all - lots of lurking, trying to keep up.
Not sure if this is Watchdog question or not.
I am coding an "attractor" mode for a static display - which cycles through demos of various games I have written (think Defener, Missile Command etc) [Will post those else where).
The idea is to leave the screen running, boot the Picomite, select a game and play portion of the game, reboot and then pickanother -- this is then left on to cycle randomly though the games.
So far I have a Menu that is autorun on boot that looks like:
OPTION EXPLICIT
OPTION DEFAULT NONE
dim attract$ as string
SELECT CASE INT(RND * 4) + 1
CASE 1
attract$ = "defender.bas"
CASE 2
attract$ = "asteroids.bas"
CASE 3
attract$ = "lander.bas"
CASE 4
attract$ = "missile.bas"
END SELECT
chain attract$
This works, as in it selects a random game demo to load.
Each game has
Option Explicit
Option Default Integer
Option Base 0
Watchdog 10000
as a standard header.
On first running, as said, a game is selected randomly, loads and plays. Then the watchdog kicks in and it restarts the CPU. BUT at that point the game just loaded restarts.
It looks like the autorun menu is not running.
Now, this might be the way watchdog is supposed to run.
If so, what are my options to:
(1) Randomly load a game
(2) Restart with a different random game
I see I can:
SETTICK period, target [, nbr]
So I could modify all the game code for those to be loaded to fire off a random interrupt to chain a new file after a random amout of time and abandon a menu load all together --- but it seems like there should be an easier way.
Current have "self playing demos" of:
Defender
Asteroids
Moon Lander
Missile Command
Tron (not great)
Gunslinger
SubHunt
Tempest (also not great)
Centipede
SeaWolf
Space Invaders
Arkanoid
Dino Jump (the Google game that plays when the internet is dead)
Pong
Plus Conway's Life and Matrix Rain)
And adding more - so would rather a menu that adding boiler plate to each one.
Any MMBasic / PicoMite way to force a new program (randomly) to load on boot from a watchdog? OR other clever stuff?
Appreciate this could be a DOH!!! question and the answer is there alluding me
Cheers
G