is there a way to use reverse characters in multicolor mode?

Basic and Machine Language

Moderator: Moderators

the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

is there a way to use reverse characters in multicolor mode?

Post by the777 »

i want to use the reversed space character. is this possible? i dont really want to have to redefine a character/multicolor character to do this. i just want to set a black background using the reversed space.
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: is there a way to use reverse characters in multicolor mode?

Post by tokra »

The reversed space will take the color of the auxiliary color (top 4 bits in $900e).

So you can surely fill the screen with these, but keep in mind one of the other two global colors will be the border-color. I usually prefer setting the border-color to the desired background colour in multicolor-mode so that the border does not stand out.
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

that wouldnt give me black with my setup. my border color (black) is the desired background color
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: is there a way to use reverse characters in multicolor mode?

Post by chysn »

the777 wrote: Tue Feb 23, 2021 9:11 am i just want to set a black background using the reversed space.
Keep in mind that multi-color mode is selected on a per-character basis by setting bit 3 in color memory. So if you want the reversed space to be black, there's no reason to use multi-color mode. The reversed space is, by definition, a mono-chromatic thing.

There is at least one good reason to use multi-color mode with reversed spaces, though; it allows you to have a block be any of the 16 available colors by (as tokra said) setting the aux color. I did exactly this in a recent game, where I wanted large swaths of orange, which isn't available outside multi-color mode.

But for black... just make it black.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

Code: Select all

10 print"[clear}"
100 poke36869, 255
104 poke38400,0
105 poke7680,160
106 print">>>>>>"
110 fori = 7168to7679
: pokei, peek(i + 2560
0): next
130 fori = 7176to7191
150 reada : pokei, a :
 next
154 x = 7690 : c = 307
20
155 pokex, 1 : pokex +
 c, 10 : pokex + 1, 2
: pokex + c + 1, 10
156 fort = 1to80 : nex
t : pokex, 32 : pokex
+ 1, 32
157 x = x + 22 : ifx>
8185then154
158 goto155
160 data93,87,90,104,1
70,162,170,125,117,213
,165,41  ,170, 138,170
,125
400 forf=0to512
410 print">";
420 next
1000 fori=7664to7671:p
okei,peek(i+26384  ):n
ext
heres the code. im using goto1000 to setup the character and then running it. the blocks come up and then disappear again. the idea is to fill the screen with blocks. is there a problem? can i not do it this way?
Attachments
xx.png
Untitled.png
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: is there a way to use reverse characters in multicolor mode?

Post by chysn »

Looks good, it's a nice character. Is there something that's not working that you think should be working differently?
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

the '>' characters should be blocks but they just disappear back to '>' s
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: is there a way to use reverse characters in multicolor mode?

Post by chysn »

the777 wrote: Tue Feb 23, 2021 11:31 am the '>' characters should be blocks but they just disappear back to '>' s
I see nothing in your code that would redefine > as a block. On what line number do you think this is happening?
Last edited by chysn on Tue Feb 23, 2021 11:51 am, edited 1 time in total.
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

1000, goto 1000.


sorry, add this line.


20 data 255,255,255,255,255,255,255,255
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: is there a way to use reverse characters in multicolor mode?

Post by chysn »

OK, I see. So, yes, every time you run your program, the loop at line 110 will reset the whole character set back to the ROM characters. That's where the custom > character is being set back to its ROM counterpart.

The code at 1000 is not executed during a RUN of this code, which may be at least one part of the problem.
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

chysn wrote: Tue Feb 23, 2021 11:50 am OK, I see. So, yes, every time you run your program, the loop at line 110 will reset the whole character set back to the ROM characters. That's where the custom > character is being set back to its ROM counterpart.

The code at 1000 is not executed during a RUN of this code, which may be at least one part of the problem.

sorry wrong bit of code, line 1000 should be:

1000 forc=7328to7335:r
eada:pokec,a:next


i type goto 1000, then run it...

that gets around that problem...
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

ok, so i got it working by deleting line 110. the problem now is that the sprite clears a green line down the screen.
i guess i may have to use a black box sprite to do this?
Attachments
ppp.png
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: is there a way to use reverse characters in multicolor mode?

Post by chysn »

the777 wrote: Tue Feb 23, 2021 8:06 pm ok, so i got it working by deleting line 110. the problem now is that the sprite clears a green line down the screen.
i guess i may have to use a black box sprite to do this?
Yeah, right now you're using 32 to clear the character's last position, which will be the background color.
the777
Vic 20 Newbie
Posts: 16
Joined: Tue Feb 23, 2021 9:08 am

Re: is there a way to use reverse characters in multicolor mode?

Post by the777 »

ok, so what number do i use? ive tried 0-255 and none of them are black, i dont think
Vic20-Ian
Vic 20 Scientist
Posts: 1214
Joined: Sun Aug 24, 2008 1:58 pm

Re: is there a way to use reverse characters in multicolor mode?

Post by Vic20-Ian »

the777 wrote: Wed Feb 24, 2021 5:18 am ok, so what number do i use? ive tried 0-255 and none of them are black, i dont think
http://www.sleepingelephant.com/denial/ ... draft3.pdf

Standard characters are 0-127

Reversed add 128

So try 160
Vic20-Ian

The best things in life are Vic-20

Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
Post Reply