CPCWiki forum

General Category => Programming => Topic started by: TFM on 21:32, 30 January 15

Title: Really Cool Control Codes!
Post by: TFM on 21:32, 30 January 15
Hi ALL!

Some control codes can do really cool things. Displaying the DIRectory of Orion Prime shows very impressive what control codes can do.

This can be beyond things like changing color, clearing screen, making a beep or stuff like that.


Now: Do you have an idea what a really cool control code could or should do?
Title: Re: Really Cool Control Codes!
Post by: ralferoo on 01:22, 01 February 15
The best ones are for Linux...

ESC [ 10 ; n ]      Set bell frequency in Hz.
ESC [ 11 ; n ]      Set bell duration in msec.
\007                Sound bell

You can have a lot of fun with these ones... :)
Title: Re: Really Cool Control Codes!
Post by: Nich on 11:35, 01 February 15
Quote from: ralferoo on 01:22, 01 February 15
The best ones are for Linux...

ESC [ 10 ; n ]      Set bell frequency in Hz.
ESC [ 11 ; n ]      Set bell duration in msec.
\007                Sound bell

You can have a lot of fun with these ones... :)

That reminds me of an Amstrad Action type-in which changed the sound of the bell. It was fun! :)
Title: Re: Really Cool Control Codes!
Post by: Gryzor on 19:06, 01 February 15
Quote from: Nich on 11:35, 01 February 15
That reminds me of an Amstrad Action type-in which changed the sound of the bell. It was fun! :)


Every little customisation and modification was fun back then :)
Title: Re: Really Cool Control Codes!
Post by: TFM on 17:19, 02 February 15
Quote from: ralferoo on 01:22, 01 February 15
The best ones are for Linux...

ESC [ 10 ; n ]      Set bell frequency in Hz.
ESC [ 11 ; n ]      Set bell duration in msec.
\007                Sound bell

You can have a lot of fun with these ones... :)


That's a great idea! Being able to play music while displaying text has something. Thanks!
Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 12:09, 24 May 15
Well I'm gonna be really BASIC here and say the Transparent Function:


PRINT CHR$(22)+CHR(1);


It only works on the Text Screen though, I tested this out my making a graphical version, which confirmed my suspicions. Unsure if Sprite Drivers which use Text Based Coordinates would work using that Function though, no harm in testing I suppose.
Title: Re: Really Cool Control Codes!
Post by: EgoTrip on 12:16, 24 May 15
Quote from: AMSDOS on 12:09, 24 May 15
Well I'm gonna be really BASIC here and say the Transparent Function:


PRINT CHR$(22)+CHR(1);


It only works on the Text Screen though, I tested this out my making a graphical version, which confirmed my suspicions. Unsure if Sprite Drivers which use Text Based Coordinates would work using that Function though, no harm in testing I suppose.

If you are using TAG to print anywhere on the screen, transparent mode does work. But if its a machine code routine then I doubt it.
Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 12:23, 24 May 15
Quote from: EgoTrip on 12:16, 24 May 15
If you are using TAG to print anywhere on the screen, transparent mode does work. But if its a machine code routine then I doubt it.


Makes sense since a Poke wouldn't care what mode it was in.
Title: Re: Really Cool Control Codes!
Post by: TFM on 16:58, 01 June 15
Transparent mode. An idea to consider :-)

Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 11:36, 05 June 15


Quote from: EgoTrip on 12:16, 24 May 15
If you are using TAG to print anywhere on the screen, transparent mode does work.


Hmmm, actually I don't think my example TAG program worked, I made one, but I don't think I posted it on here, but was a variation of a program I posted in the "Silly Programming ideas - Turning Text into Graphics", but can always post it if anyone was wondering, who knows perhaps I coded it incorrectly.

Quote from: TFM on 16:58, 01 June 15
Transparent mode. An idea to consider :-)


Works very well when dealing in Text Coordinate Positions, I made a graphical cursor calculated based on where the Text cursor would be placed, so each time I moved it, the contents from the Array would be drawn back which in a way replaces Transparent.
In my mind I'm trying to place how Dizzy moves around the maze in Fast Food without Destroying the Background, the simplest explanation would seem to be it's a reoccurring backdrop, so memory could be saved by simply drawing it over and over. The Twins must of worked out which part of the block Dizzy is covering and be able to reveal backdrop when Dizzy moves any which way. Or is that sounding too complicated?
Title: Re: Really Cool Control Codes!
Post by: ZbyniuR on 13:54, 05 June 15
If you want transparent in TAG, use code 23, not 22. For example:
10 PRINT CHR$(23)CHR$(3):TAG:MOVE 320,200:?"a";:MOVE 320,200:PRINT CHR$(162);
It give in TAG german "a". :)

Parameter after code 23:
0 normal
1 XOR invers
2 AND only common
3 OR transparent
Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 23:34, 06 June 15
Quote from: ZbyniuR on 13:54, 05 June 15
If you want transparent in TAG, use code 23, not 22. For example:
10 PRINT CHR$(23)CHR$(3):TAG:MOVE 320,200:?"a";:MOVE 320,200:PRINT CHR$(162);
It give in TAG german "a". :)

Parameter after code 23:
0 normal
1 XOR invers
2 AND only common
3 OR transparent


Right, well I'll have to try this out on my example.
Title: Re: Really Cool Control Codes!
Post by: andycadley on 23:55, 06 June 15
Quote from: AMSDOS on 11:36, 05 June 15
In my mind I'm trying to place how Dizzy moves around the maze in Fast Food without Destroying the Background, the simplest explanation would seem to be it's a reoccurring backdrop, so memory could be saved by simply drawing it over and over. The Twins must of worked out which part of the block Dizzy is covering and be able to reveal backdrop when Dizzy moves any which way. Or is that sounding too complicated?
I can't see any reason to assume it's anything other than a traditional masked sprite routine, with a tiled background. Pretty straightforward fare.
Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 23:45, 07 June 15
Quote from: andycadley on 23:55, 06 June 15
I can't see any reason to assume it's anything other than a traditional masked sprite routine, with a tiled background. Pretty straightforward fare.


Well I usually try to overcomplicate things.



Title: Re: Really Cool Control Codes!
Post by: AMSDOS on 11:49, 10 June 15
Quote from: ZbyniuR on 13:54, 05 June 15
If you want transparent in TAG, use code 23, not 22. For example:
10 PRINT CHR$(23)CHR$(3):TAG:MOVE 320,200:?"a";:MOVE 320,200:PRINT CHR$(162);
It give in TAG german "a". :)

Parameter after code 23:
0 normal
1 XOR invers
2 AND only common
3 OR transparent


Seems to work very well, though I'm moving my TAGged character around in Character Blocks which is a lot less complicated than in Pixel calculations.
I was trying some experimenting in BASIC by creating an array defined in pixels, the array holds the values of the Background colours and are somehow recovered as the image passes over the top. Obviously I'm not concerned about Speed in this case, their simply half-baked ideas.  :D
Title: Re: Really Cool Control Codes!
Post by: ZbyniuR on 14:07, 10 June 15
PRINT with TAG can be use as simple sprite, even in colors.
Try my "half-baked idea"  run"gui    :)
Title: Re: Really Cool Control Codes!
Post by: TFM on 16:24, 10 June 15
Quote from: ZbyniuR on 14:07, 10 June 15
PRINT with TAG can be use as simple sprite, even in colors.
Try my "half-baked idea"  run"gui    :)


Cool! Looks already better than other CPC GUIs which are flooded by too much - too small windows.
Title: Re: Really Cool Control Codes!
Post by: CraigsBar on 16:27, 10 June 15
Quote from: TFM on 16:24, 10 June 15

Cool! Looks already better than other CPC GUIs which are flooded by too much - too small windows.
I never found DES too cluttered or too small  ;) not something I'd accuse SymbOS of either.
Title: Re: Really Cool Control Codes!
Post by: TFM on 17:07, 10 June 15
Oh well, my eyesight is not the best and I really appreciate a clear construction of a GUI, therefore I don't like Windows at all. They just make the screen area smaller. It's a question of personal taste and probably even more the way "we grow up" with OS.
However I really like his screen shot. And DES is actually pretty near, like MAX too. Even because they are not to cluttered.
Title: Re: Really Cool Control Codes!
Post by: CraigsBar on 19:24, 10 June 15
Quote from: TFM on 17:07, 10 June 15
Oh well, my eyesight is not the best and I really appreciate a clear construction of a GUI, therefore I don't like Windows at all. They just make the screen area smaller. It's a question of personal taste and probably even more the way "we grow up" with OS.
However I really like his screen shot. And DES is actually pretty near, like MAX too. Even because they are not to cluttered.
I paid for des on ROM. I used to autoboot it on my plus. When we have the third and final cartmaker from @arnoldemu I'll be making the following...

Des cart
Protext suite cart
Symbos cart

I'd love to see if a brunword elite 4 cart is possible but that is beyond my skill.

These would make great c4cpc images.
Title: Re: Really Cool Control Codes!
Post by: TFM on 19:27, 10 June 15
Great idea, add Maxam to Protext Cart if you like.  ;D
Title: Re: Really Cool Control Codes!
Post by: FloppySoftware on 23:32, 10 June 15
Quote from: ZbyniuR on 14:07, 10 June 15
PRINT with TAG can be use as simple sprite, even in colors.
Try my "half-baked idea"  run"gui    :)

Looks very nice! :)
Title: Re: Really Cool Control Codes!
Post by: CraigsBar on 00:35, 11 June 15
Quote from: TFM on 19:27, 10 June 15
Great idea, add Maxam to Protext Cart if you like.  ;D
I was gonna put the whole armor suite, so utopia and bpcl as well.

But like the games carts I have waiting on parados 80 format discs, I an dependant on the tools. :(
Title: Re: Really Cool Control Codes!
Post by: TFM on 16:32, 11 June 15
Sounds interesting, even if Utopia is not really compatible with everything.


Now back to the topic: The idea was to have control codes to move sprites around on screen, that's actually an pretty neat idea. Collision detection would be another size of bullet thought.



Powered by SMFPacks Menu Editor Mod