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 : is there a way to quit out of a program and stay in the mode I was in?

Author Message
berighteous
Senior Member

Joined: 18/07/2020
Location: United States
Posts: 110
Posted: 12:20am 17 Aug 2020
Copy link to clipboard 
Print this post

Hey all!
I'm programming in mode 3,8, but every time I hit an error or end the program or control-c to stop it, it throws me back to mode 1,8 and I lose everything that I have written to all my memory pages.  I'd like to stay in the mode I'm in so I can check if things are set to the right place, or manually check each page or whatever.  

Is there a way to not have it reset all the memory pages and switch to 1,8?
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 12:31am 17 Aug 2020
Copy link to clipboard 
Print this post

  berighteous said  Hey all!
I'm programming in mode 3,8, but every time I hit an error or end the program or control-c to stop it, it throws me back to mode 1,8 and I lose everything that I have written to all my memory pages.  I'd like to stay in the mode I'm in so I can check if things are set to the right place, or manually check each page or whatever.  

Is there a way to not have it reset all the memory pages and switch to 1,8?


Me too, also my display takes a while to switch modes. Sometimes I switch modes before starting the program so I don't miss the start of it.

I wouldn't be surprised if there's an option for setting the default screen mode ... checking .. can't see one. Maybe writing an error handler in basic that shows the error and pauses or waits for a keypress before really ending the program?
 
Womble

Senior Member

Joined: 09/07/2020
Location: United Kingdom
Posts: 267
Posted: 12:32am 17 Aug 2020
Copy link to clipboard 
Print this post

  berighteous said  Is there a way to not have it reset all the memory pages and switch to 1,8?

You might try using the Serial Console to control/program your CMM2 and use OPTION CONSOLE SERIAL to disable the VGA console.

I have not tried this myself, but looking at the manual it should be a work around whilst developing.  Use terraterm or similar on the pc, and connect it to the CMM2 with the USB A-B cable.

The manual states:
OPTION CONSOLE SERIAL will disable the console output to the
VGA screen and send all output to the serial console. This is useful
for debugging graphics applications as diagnostic PRINT statements
will not corrupt the screen display.


Worth an experiment.
 
berighteous
Senior Member

Joined: 18/07/2020
Location: United States
Posts: 110
Posted: 12:45am 17 Aug 2020
Copy link to clipboard 
Print this post

My CMM2 is in a different room than my PC.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5089
Posted: 06:13am 17 Aug 2020
Copy link to clipboard 
Print this post

Is it an idea to program the <ctrl C> action into the game ?

Typically a game consists of a loop where input is processed (keyboard and or nunchuck) and output is generated (sound/video). If in this loop you add an inkey$ command to break the loop you should stay in the same video mode.

something like
a$=inkey$:if a$="q" then end

PicomiteVGA PETSCII ROBOTS
 
berighteous
Senior Member

Joined: 18/07/2020
Location: United States
Posts: 110
Posted: 06:39am 17 Aug 2020
Copy link to clipboard 
Print this post

end drops back to 1,8.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 07:16am 17 Aug 2020
Copy link to clipboard 
Print this post

In answer to the title question, the answer is no. Errors and ctrl-C trigger a longjmp to the start of the firmware. The program has to know that it has a usable mode, colour map, font etc. in order to output the error message. However, it is only the first 512KB of video memory that is overwritten. If you store the info you want to inspect in a page >=4 (mode 3,8) then it will still be there. Enter the following at the command line:


mode 3,16
page write 10
cls rgb(red)
do:loop


Ctrl-C

mode 3,16
page copy 10 to 0

Edited 2020-08-17 17:17 by matherp
 
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