Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:45 27 Nov 2024 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 : MMBasic for Windows: Weird mode 12 behaviour

Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 03:45am 26 Nov 2023
Copy link to clipboard 
Print this post

Hello everyone

I'm trying to understand why page 0 stops rendering after a cls. I'm using the last version shared by matherp.

Steps to reproduce:

1) Save in a file and run the following code:


mode 7,12
font 1

page write 0
print @(100,0) "Hello page 0"
print @(100,32)  "Hello page 0 - "+str$(int(rnd()*100))

page write 1
print @(100,16)  "Hello page 1"
print @(100,48)  "Hello page 1 - "+str$(int(rnd()*100))


It will print four lines with the Hello page X text.

2) Type CLS in the basic console

3) Run the code again

Only the text from page 1 will be rendered.

It's necessary to restart the MMBasic environment to make page 0 work again.

Did I miss something?
Edited 2023-11-26 13:46 by LeoNicolas
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 04:17pm 26 Nov 2023
Copy link to clipboard 
Print this post

I'm running MMBasic on Wine, I don't know if it could be the cause.

Please, let me know if the problem is happening in your computers.

The cls command can be inside the program as well. The same behaviour will manifest.

The is a problem for my game because I can't clear the pages 0 and 1 before starting the stage. If I do it, I completely lose the page 0.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9121
Posted: 04:53pm 26 Nov 2023
Copy link to clipboard 
Print this post

Not near a computer for a few days but try "CLS 0"
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 06:19pm 26 Nov 2023
Copy link to clipboard 
Print this post

  matherp said  Not near a computer for a few days but try "CLS 0"


Thank you matherp. "cls 0" works fine but "cls 1" is not clearing the page 1.
Edited 2023-11-27 04:31 by LeoNicolas
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 06:57pm 26 Nov 2023
Copy link to clipboard 
Print this post

The number after CLS is a colour, not a page number.
Visit Vegipete's *Mite Library for cool programs.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 479
Posted: 07:01pm 26 Nov 2023
Copy link to clipboard 
Print this post

Thank you vegipete

I'd assumed wrong.
 
Print this page


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

© JAQ Software 2024