Request: Setting background color

Previous topic - Next topic

Wampus

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.

Kitty Hello

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.

AMC

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...)

Quentin

lol, yes I remember something about the Mode 13 Magic, drawing directly to the video memory

ketil

Quote from: AMC 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."

BlueSteel

poke 53280,0-15 changed BG colour on the C64
poke 53281,0-15 changed border colour on the C64

or visa versa ;)

Kitty Hello

and poke 646, colour for the text colour.

MrTAToad

1024-2023 for the text screen
$C000-$CFFF for free 8K ram
$D000+ for sprites
$FFD2 for printing text
$FFF0 for moving the cursor

:)

Moru

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

On a RISC OS machine, you would use SWI "OS_SpriteOp" for sprites, which in ARM assembler would be :

MOV R0,#2
SWI &2E

ketil

Quote from: Kitty Hello 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."

BlueSteel

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

ketil

Quote from: BlueSteel 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."

BlueSteel

yup just a typo i'm full of them :( sorry

Millerszone

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