![]() |
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 StatesPosts: 110 |
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: AustraliaPosts: 341 |
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 KingdomPosts: 267 |
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 StatesPosts: 110 |
My CMM2 is in a different room than my PC. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5089 |
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 StatesPosts: 110 |
end drops back to 1,8. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
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 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |