MSX 1 Graphics Charachter Table Corrupt ?

Door Hit-Biter

Master (163)

afbeelding van Hit-Biter

24-08-2022, 12:48

Hey guys, Hope someone can help. Ive been entering a program into my Toshiba HX10 and have a small graphics glitch. Ive had a few actually and most were traced back to small data errors or in one instance an error in the actual listing. However this time i think it might be a little more serious. So in the game there are two 'platforms' comprised of the Graphics Character SHIFT+GRAPH+E. This forms a small triangle pointing up. IN the program it is printed at a specific point and repeated 4 times to form the platform. NOW i tried looking for errors and messing with the program but nothing would get rid of the little dot above each triangle ! The dot floats a pixel or two above the triangle ! Now Ive examined the triangle and the right most pixel of the triangle is missing ! I tested all the graphics characters and i think some might be missing entirely and the smiley face graphic has a whole side of pixels missing so it looks like a reversed capital D rather than a Capital O ! So I'm leaning towards a hardware issue now. Any thoughts ? How can I test this ? How do I fix this ?

Aangemeld of registreer om reacties te plaatsen

Van Micha

Expert (72)

afbeelding van Micha

24-08-2022, 13:07

About the dot above the triangle: probably you vpoked somewhere at the wrong place in videomemory ? Is it there when you reset the computer and do nothing but typing shift+graph+e ?
About the smiley face: it looks like an O in screen 1 or 2; but it will look like a reversed capital D if you try it in screen 0 (because in screen 0 all characters are only 6 pixels wide instead of 8)

Van Hit-Biter

Master (163)

afbeelding van Hit-Biter

24-08-2022, 19:05

Micha wrote:

About the dot above the triangle: probably you vpoked somewhere at the wrong place in videomemory ? Is it there when you reset the computer and do nothing but typing shift+graph+e ?
About the smiley face: it looks like an O in screen 1 or 2; but it will look like a reversed capital D if you try it in screen 0 (because in screen 0 all characters are only 6 pixels wide instead of 8)

OK I've rebooted the MSX and tried the Graphics characters i was having the issue with in screen 1 and screen 2 and they are displayed correctly. Smile So that means I do have a program listing error and not a hardware fault as i had feared.

So that's good news. Ive been bug-fixing this program for about a week or two now and know it quite well. Its only about 200 lines or so.. SO I KNOW there are no VPOKE/VPEEK commands in the listing at all PERIOD :/

BUT when i load the program the program still displays SHIFT+GRAPH+E with the dot in the wrong place :/ Its like its in screen 0 but I've checked the listing and it should be requesting screen 2,2 at line 760 or there about before Print#1,"SHIFT+GRAPH+E" about line 940. Tricky ! :/

Van Micha

Expert (72)

afbeelding van Micha

24-08-2022, 19:56

Hit-Biter wrote:

BUT when i load the program the program still displays SHIFT+GRAPH+E with the dot in the wrong place :/ Its like its in screen 0 but I've checked the listing and it should be requesting screen 2,2 at line 760 or there about before Print#1,"SHIFT+GRAPH+E" about line 940. Tricky ! :/

Ah I think I see what has happened; the "characters" are drawn on the screen by PRINT #1," etc. Before the PRINT statement a PSET statement is used to move to the correct screen position. The dot you see comes from the PSET statement in lines 940 and 970. If you would have used the character "M" as in the original listing, the upper left dot is also in the character itself. By using the shift-graph-e triangle which doesn't have the dot in the upper left you will see the dot from the pset.
You can fix this by doing it as in the original listing and use the "M", or change the pset statements in PSET(T,70),0 and PSET(T,100),0 !

Van Hit-Biter

Master (163)

afbeelding van Hit-Biter

24-08-2022, 20:33

Micha wrote:
Hit-Biter wrote:

BUT when i load the program the program still displays SHIFT+GRAPH+E with the dot in the wrong place :/ Its like its in screen 0 but I've checked the listing and it should be requesting screen 2,2 at line 760 or there about before Print#1,"SHIFT+GRAPH+E" about line 940. Tricky ! :/

Ah I think I see what has happened; the "characters" are drawn on the screen by PRINT #1," etc. Before the PRINT statement a PSET statement is used to move to the correct screen position. The dot you see comes from the PSET statement in lines 940 and 970. If you would have used the character "M" as in the original listing, the upper left dot is also in the character itself. By using the shift-graph-e triangle which doesn't have the dot in the upper left you will see the dot from the pset.
You can fix this by doing it as in the original listing and use the "M", or change the pset statements in PSET(T,70),0 and PSET(T,100),0 !

Ahh Super. The ,0 is to set the PSET command to transparent so its still drawing a dot but its 'invisible'. I'm still learning so if i may ask why not use LOCATE command instead of PSET ? Or could PRESET even be used in this circumstance. It seems like I'm adding complexity where i don't need it :/ I was getting help from someone else and they were very helpful explaining things but I noticed that they had the CTRL/graph/e combo on there screenshot while i was using M. There may well be a couple of versions of this listing floating about but every error or glitch i correct means I'm learning something new every time. I'm still learning the BASIC Statements/commands currently so there's quite a lot to absorb.

Van Briqunullus

Hero (584)

afbeelding van Briqunullus

24-08-2022, 20:37

Hit-Biter wrote:

I tested all the graphics characters and i think some might be missing entirely and the smiley face graphic has a whole side of pixels missing

Hi Paul, did you test these in SCREEN 0? SCREEN 0 has 6 pixel wide characters. The 2 rightmost pixels will be omitted. That will indeed distort the graphical characters. Nothing to worry about. Go to SCREEN 1, run your test again and all will be fine.

Furthermore, I think Micha has you covered on the pixel issue. Buy if I recall correctly, in the game the triangle should be pointing downwards. Is that GRAPH + E? Without SHIFT? That way the pixel will be overwritten by the triangle and nobody will ever know the pixel was even there.

Van Hit-Biter

Master (163)

afbeelding van Hit-Biter

24-08-2022, 22:17

Briqunullus wrote:
Hit-Biter wrote:

I tested all the graphics characters and i think some might be missing entirely and the smiley face graphic has a whole side of pixels missing

Hi Paul, did you test these in SCREEN 0? SCREEN 0 has 6 pixel wide characters. The 2 rightmost pixels will be omitted. That will indeed distort the graphical characters. Nothing to worry about. Go to SCREEN 1, run your test again and all will be fine.

Furthermore, I think Micha has you covered on the pixel issue. Buy if I recall correctly, in the game the triangle should be pointing downwards. Is that GRAPH + E? Without SHIFT? That way the pixel will be overwritten by the triangle and nobody will ever know the pixel was even there.

Ahhh That makes sense. Yea Ive tested screen 0 versus screen 1 or2 and the graphics charachters work fine. It was the Pset issue with the graph E versus M that was the issue. I'm sorted now but will try inverting the triangles and removing transparency to see the effect. This has been fun. Ive learned so much from this program already. Ive resolved all bugs at this point. Ive still one or two areas i need to figure out how they work but im wanting to move onto another program soon.

Van Micha

Expert (72)

afbeelding van Micha

25-08-2022, 08:12

Hit-Biter wrote:

I'm still learning so if i may ask why not use LOCATE command instead of PSET ? Or could PRESET even be used in this circumstance.

I think any MSX-Basic manual would cover this better and more extensive than a forum answer. Read the manual, keep playing/trying and you will learn!

Van thegeps

Paragon (1125)

afbeelding van thegeps

25-08-2022, 16:42

Screen2 on MSX basic is intended as graphic mode, so allow only graphic command. Infact you have to open the screen as a device (open "grp:") to be able to write on it using print#
In this way you are able to start your printings everywhere on the screen and nor limited to 8 pixel multiples.
It is slow, because the basic interpreter need to calculate wich pixel must set on screen
You can redefine your chars (tiles) and then vpoke them on screen, but you need to redefine them 3 times (screen 2 has 3 blocks of 256 characters, one every 8 lines, infact 8x32=256 but it is full of posts in this forum that explain this) but vpoke too is slow compared to LOCATE/PRINT.
To be able to use LOCATE/PRINT on screen2 you have to trick the VDP but I think that it is too much for you at this point.
Keep learning the whole "official" basic peogramming and then we will teach you some "secrets" Wink