Author Topic: How to get screen MODE?  (Read 860 times)

0 Members and 1 Guest are viewing this topic.

Offline litwr

  • CPC664
  • ***
  • Posts: 143
  • Country: ru
    • lidovski's www page
  • Liked: 113
Re: How to get screen MODE?
« Reply #10 on: 19:18, 12 September 16 »
Thanks!  :) However it would be a bit better to have a proper word in Basic.  ;)

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.336
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 605
Re: How to get screen MODE?
« Reply #11 on: 22:33, 12 September 16 »
You can't find out from the hardware, the only way is to keep track of what value you last sent to the gate array (which is how the firmware call knows). If you need to know what mode you're in from something that is going to disable the firmware (but doesn't reset the mode itself) then you'll need to call SCR GET MODE before disabling the firmware and then keep that value up to date yourself.

Looking at all the replies it appears there's all sorts of tricks you could do to find out the screen mode.  :)

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.194
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2021
Re: How to get screen MODE?
« Reply #12 on: 22:39, 12 September 16 »
Thanks!  :) However it would be a bit better to have a proper word in Basic.  ;)
i there a basic command to make a sprite and move it on the screen in commodore basic?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 728
  • Liked: 293
Re: How to get screen MODE?
« Reply #13 on: 22:48, 12 September 16 »
Thanks!  :) However it would be a bit better to have a proper word in Basic.  ;)

I assume the thinking was that since the graphics commands in Basic are meant to be resolution independent, there would be little call for actually knowing the screen mode via a command.

Looking at all the replies it appears there's all sorts of tricks you could do to find out the screen mode.  :)

They all fundamentally rely on the fact the firmware is keeping track of the mode, if it wasn't then PLOT wouldn't be able to write different values to the display depending upon the current mode. The hardware itself doesn't provide any mechanism for determining a change "after the fact"

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 728
  • Liked: 293
Re: How to get screen MODE?
« Reply #14 on: 22:51, 12 September 16 »
i there a basic command to make a sprite and move it on the screen in commodore basic?

POKE. :P

But then the C64 doesn't actually have any graphics commands in basic at all! Things like RGR appear on later machines like the Plus 4, which didn't have sprites IIRC.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.194
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2021
Re: How to get screen MODE?
« Reply #15 on: 23:15, 12 September 16 »
POKE. :P

But then the C64 doesn't actually have any graphics commands in basic at all! Things like RGR appear on later machines like the Plus 4, which didn't have sprites IIRC.
exactly!

CPC Basic lacks RGR, and Commodore BASIC lacks basic commands for sprites!
So neither BASIC is perfect.  :D



My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.336
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 605
Re: How to get screen MODE?
« Reply #16 on: 03:24, 13 September 16 »

They all fundamentally rely on the fact the firmware is keeping track of the mode, if it wasn't then PLOT wouldn't be able to write different values to the display depending upon the current mode. The hardware itself doesn't provide any mechanism for determining a change "after the fact"

Yep, so the screen mode would have to be obtained before disabling the firmware. Normally you would only do this if you wanted to return back to BASIC in the mode it was in usually. Using the hardware has little need for it, which I presume the reason why it hasn't got it.

Offline litwr

  • CPC664
  • ***
  • Posts: 143
  • Country: ru
    • lidovski's www page
  • Liked: 113
Re: How to get screen MODE?
« Reply #17 on: 20:28, 14 September 16 »
i there a basic command to make a sprite and move it on the screen in commodore basic?
C16/+4 have no hardware sprites  (so as CPC6128).  C128 Basic has such commands.  Locomotive Basic is fast but misses several good commands.
I used CPC6128, PCW8256 and PCW9512.   :)  They are good PC, maybe the best z80 based PC.  The problem of 6502/6809 based PC that they might be better but were often restricted artificially.  For example, C128 might be 2 times faster and use 256 KB memory.  Z80 had much better support...  IMHO it was a bit unfair.

Offline ZbyniuR

  • CPC6128
  • ****
  • Posts: 262
  • Country: pl
  • 6128 A1230 PSX Win7
    • Jedyne polskie forum o CPC. :)
  • Liked: 220
Re: How to get screen MODE?
« Reply #18 on: 18:51, 17 September 16 »
Pure BASIC solution for any CPC:

10 IF PEEK(&BB5B)=0 THEN m=PEEK(&B1C8) ELSE m=PEEK(&B7C3)

TREK is better than WARS.