Author Topic: Request: Setting background color  (Read 13595 times)

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
Re: Request: Setting background color
« Reply #30 on: 2010-May-26 »
A suggestion: With a new CLEARSCREEN command, can there be the option to not clear the back buffer at all?

The reason I ask is that many applications will always completely cover the screen every frame so BLACKSCREEN or USEASBMP will needlessly use up precious CPU cycles.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10709
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Request: Setting background color
« Reply #31 on: 2010-May-31 »
useasbmp will not clear but use a bitmap instead of the clear. The clearscreen sets a colour to clear. You can't keep the current garbage, though if you want that. Use USEASBMP instead.

Offline AMC

  • Mc. Print
  • *
  • Posts: 5
  • I bought it for my GP2x...
    • View Profile
Re: Request: Setting background color
« Reply #32 on: 2010-Aug-21 »
Kitty is correct. Clearing a screen using a bitmap is quite slow. Clearing the screen direct is much faster - no copy involved - just direct to memory - Does no-one remember $0a0000 and a bit of "rep stosw" back in the old days, or I am the last of the ASM coders???
XOR AX,AX - A Fast Zero... (Those were the days...)

Offline Quentin

  • Prof. Inline
  • *****
  • Posts: 915
    • View Profile
Re: Request: Setting background color
« Reply #33 on: 2010-Aug-21 »
lol, yes I remember something about the Mode 13 Magic, drawing directly to the video memory

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Request: Setting background color
« Reply #34 on: 2010-Aug-21 »
Kitty is correct. Clearing a screen using a bitmap is quite slow. Clearing the screen direct is much faster - no copy involved - just direct to memory - Does no-one remember $0a0000 and a bit of "rep stosw" back in the old days, or I am the last of the ASM coders???

Hmmm ... i remember the eighties:

PRINT CHR$(147)

That line was clearscreen on  <3 COMMODORE 64  <3

"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline BlueSteel

  • Mc. Print
  • *
  • Posts: 39
  • Jack of ALL codes .. master of none :(
    • View Profile
    • Coding Monkeys
Re: Request: Setting background color
« Reply #35 on: 2010-Aug-25 »
poke 53280,0-15 changed BG colour on the C64
poke 53281,0-15 changed border colour on the C64

or visa versa ;)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10709
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Request: Setting background color
« Reply #36 on: 2010-Aug-25 »
and poke 646, colour for the text colour.

MrTAToad

  • Guest
Re: Request: Setting background color
« Reply #37 on: 2010-Aug-25 »
1024-2023 for the text screen
$C000-$CFFF for free 8K ram
$D000+ for sprites
$FFD2 for printing text
$FFF0 for moving the cursor

:)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1774
    • View Profile
    • Homepage
Re: Request: Setting background color
« Reply #38 on: 2010-Aug-25 »
Well, one step up on the computer ladder, still no protected memory area :-)

Atari ST:
move.l   #$ff000000,$ffff9800.w ;Red background

Atari Falcon:
add.w   #2,$ffff82a8.w   ;lower Vertical Display Begin (moves screen 2 pixels down)
add.w   #2,$ffff82aa.w   ;lower Vertical Display End

Well actually I think you had to be in supervisor mode to do those but that wasn't more than a trap-call and done.

MrTAToad

  • Guest
Re: Request: Setting background color
« Reply #39 on: 2010-Aug-25 »
On a RISC OS machine, you would use SWI "OS_SpriteOp" for sprites, which in ARM assembler would be :

MOV R0,#2
SWI &2E

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Request: Setting background color
« Reply #40 on: 2010-Aug-25 »
and poke 646, colour for the text colour.

I actually still remember all of the c64 kernel, i/o, kernelstuff and mapped addresses of my head :)

Too bad out legacy on CSDb is just som crap mostly from temporary members: http://noname.c64.org/csdb/group/?id=671
"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline BlueSteel

  • Mc. Print
  • *
  • Posts: 39
  • Jack of ALL codes .. master of none :(
    • View Profile
    • Coding Monkeys
Re: Request: Setting background color
« Reply #41 on: 2010-Aug-28 »
poke 53272 + were the pokes for sound from my aging memory.. (I STILL have the C64 Programmers reference guide and use it occasionally on my C64 emulator ;) )

I have a few C64 programs that i wrote that i'd love to convert over but with all the peeks/pokes and printed special characters etc it would bew a nightmare

Offline ketil

  • Mr. Polyvector
  • ***
  • Posts: 117
    • View Profile
Re: Request: Setting background color
« Reply #42 on: 2010-Aug-28 »
poke 53272 + were the pokes for sound from my aging memory.. (I STILL have the C64 Programmers reference guide and use it occasionally on my C64 emulator ;) )

I have a few C64 programs that i wrote that i'd love to convert over but with all the peeks/pokes and printed special characters etc it would bew a nightmare

I guess you have a typo (53272 x 54272)

53272 ($d018)= screen and charset pointer (hi/low nybbles).
54272-54230 ($D400 - $D41C) is the sound memory (sid mappings) - I wrote a musicplayer for c64 a few months ago :)
"Sugar makes the world go 'round. Caffeine makes it spin faster."

Offline BlueSteel

  • Mc. Print
  • *
  • Posts: 39
  • Jack of ALL codes .. master of none :(
    • View Profile
    • Coding Monkeys
Re: Request: Setting background color
« Reply #43 on: 2010-Aug-29 »
yup just a typo i'm full of them :( sorry

Offline Millerszone

  • Dr. Type
  • ****
  • Posts: 307
  • www.smashedfly.com
    • View Profile
    • Smashed Fly
Hardware: iMac 27", MacBook Air, PC 3.5Ghz Quad
Developing Tools: GLBasic SDK, Gideros Studio, PureBasic
Developing for: iOS, Android, Windows, OS X, webOS, HTML5