can't use alternate charset as all standard charset in Lores1

The Oric video chip is not an easy beast to master, so any trick or method that allows to achieve nice visual results is welcome. Don't hesitate to comment (nicely) other people tricks and pictures :)
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

can't use alternate charset as all standard charset in Lores1

Post by goyo »

hi, i would like to redefine std charset for a text mode game, so before I d like to transferate the std charset memory to aleternate charset memory . I have to use all standard charset for all my sprites, so I could use all originals charset (ABC....) in the first line of TEXT mode as a Lores1 text line...

Its work but it's seems that we can redefine only 80 charset of the alternate charset, we can't keep/save all the standard charset as substitute...?

Code: Select all

10 CLS  flag_fr  flag_fr  flag_fr 
20 FOR I=0 TO (80*8) # 80 max 
30 O=PEEK(#B500+I) # after 31..
40 POKE(#B900+I),O # after 31..
50 NEXTI
60 LORES1 
70 PRINT"WE ARE ON LORES1 MODE & REDEF STD CHAR"
80 FOR I=32TO128
90 PRINT CHR$(I);
100 NEXT I
110 PLOT 10,10,32+81 # we can't redefine this one 
my game screen :
https://lh6.googleusercontent.com/PLo7s ... sE5g=w1280
User avatar
iss
Wing Commander
Posts: 1680
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: can't use alternate charset as all standard charset in Lores1

Post by iss »

goyo wrote: Wed Jun 19, 2024 2:20 pm... seems that we can redefine only 80 charset of the alternate charset.
Sad but true! Only 80 alt-chars can be used in text mode:

Code: Select all

#BB80 - #B900 = #280 = 640 => 640 / 8 (bytes per char) = 80 chars
User avatar
Dbug
Site Admin
Posts: 4742
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: can't use alternate charset as all standard charset in Lores1

Post by Dbug »

I get a 403 error on your link.

It's possible to use the entire 96 characters of the ALT charset, the problem is that the last 16 characters overlap with the 128 (16*8) first bytes of the TEXT screen.

A common solution is to display a HIRES banner at the top of the screen, if you put like 4 lines of HIRES and then go back to TEXT, you can have your last 16 characters safely protected.
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

Dbug wrote: Wed Jun 19, 2024 3:21 pm I get a 403 error on your link.

It's possible to use the entire 96 characters of the ALT charset, the problem is that the last 16 characters overlap with the 128 (16*8) first bytes of the TEXT screen.

A common solution is to display a HIRES banner at the top of the screen, if you put like 4 lines of HIRES and then go back to TEXT, you can have your last 16 characters safely protected.
Thank you Dbug for your explanation. It's an interesting trick !
I understand better.

my link works from my mobile ...
User avatar
Sodiumlightbaby
Flight Lieutenant
Posts: 352
Joined: Thu Feb 22, 2024 11:38 am

Re: can't use alternate charset as all standard charset in Lores1

Post by Sodiumlightbaby »

goyo wrote: Wed Jun 19, 2024 4:58 pm my link works from my mobile ...
It looks like the files may be private to you.

Code: Select all

Your client does not have permission to get URL /PLo7sIfh6uhP8e9uWn0WJOecCMvLLCHhmFSSyTFs8CJldO7KUJ14SWmwQ55WHGPghUz5aGRvKu5iaYQ9dV9l8_q02vnmvbcWZYHvP-i6kPri5CLdvPXHBChszDcI6UsE5g=w1280 from this server.
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

There is the screen capture of my game. I have to use all the standard charset to redefine them and i get all alternate charset to keep the alphanumeric charset in the first screen line in Lores 1 mode, this for the score , lives or debug variables etc....

My tile engine is too slow in C (0.9 seconds)
I have to make some subroutines in asm to make it more speed (~x10), i hope.
I handle composed tile (3x3) like in the Arcade Ghost n Goblins (2x2) game engine.
If my work can be done with this tile engine, Maybe I could use it to make a 1srt level of Ghost n Goblins demo with her mutlidirectionnal scrolling.
The aim is to make the maximum of lookup tables in asm to inprove the game speed.

here is a http link from free hosting.
Image
http://rari.free.fr/cd.png
User avatar
Sodiumlightbaby
Flight Lieutenant
Posts: 352
Joined: Thu Feb 22, 2024 11:38 am

Re: can't use alternate charset as all standard charset in Lores1

Post by Sodiumlightbaby »

This should be a constrained enough use case that you can use the alternate character set, but you need to limit your use to ASCII characters with code up to and including 111/0x6f/"o". So upper case letters and numbers should work fine.

Using the great iss Oric Fonter (click normal-Oric), you can see the lower line of characters is what you need to avoid using.

But looking at your picture, it looks like the garbled parts are actually pieces from your character and tile-set down in the standard character set, so what I think might possibly also be happening is that the first text line isn't set correct for using only the alternate character set (assuming that is what you want). Could it be that the routine for copying the whole standard set has written into screen memory, and there are left over character set data in that line? If so, try only copying upto the start of the text screen address.

Character set data only use the lower 6 bit in each byte, and will easily look like attributes by the ULA if is pointed to it as text. A trick if one wants to experiement with double use/overlapping memories is to set one or both of the upper bits in each byte of character bitmap so the ULA doesn't interpret them as attributes. But I don't think this is useful in your case.
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

Sodiumlightbaby wrote: Thu Jun 20, 2024 5:13 am This should be a constrained enough use case that you can use the alternate character set, but you need to limit your use to ASCII characters with code up to and including 111/0x6f/"o". So upper case letters and numbers should work fine.

Using the great iss Oric Fonter (click normal-Oric), you can see the lower line of characters is what you need to avoid using.

But looking at your picture, it looks like the garbled parts are actually pieces from your character and tile-set down in the standard character set, so what I think might possibly also be happening is that the first text line isn't set correct for using only the alternate character set (assuming that is what you want). Could it be that the routine for copying the whole standard set has written into screen memory, and there are left over character set data in that line? If so, try only copying upto the start of the text screen address.

Character set data only use the lower 6 bit in each byte, and will easily look like attributes by the ULA if is pointed to it as text. A trick if one wants to experiement with double use/overlapping memories is to set one or both of the upper bits in each byte of character bitmap so the ULA doesn't interpret them as attributes. But I don't think this is useful in your case.
Thank you Sodiumlightbaby for your advice and remarks.
I wasn't familiar with Iss's tools, they're quite interesting.

I d like to use Iss's Oricutron APK on my mobile, but unfortunately, the APK doesn't work with my recently version of Android anymore.
Therefore, I have 80 charset to display the score or other information on the first line, which should be sufficient."
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

It's work, thank you !
I could use the 80 alternate charset and redefine them. Now I can use all the standard charset for my sprites and I can use 1st texte line for the game informations.
total redefined : 177 charset

Image
http://rari.free.fr/cd2.png
User avatar
Sodiumlightbaby
Flight Lieutenant
Posts: 352
Joined: Thu Feb 22, 2024 11:38 am

Re: can't use alternate charset as all standard charset in Lores1

Post by Sodiumlightbaby »

goyo wrote: Sun Jun 23, 2024 5:08 pm It's work, thank you !
I could use the 80 alternate charset and redefine them. Now I can use all the standard charset for my sprites and I can use 1st texte line for the game informations.
total redefined : 177 charset

Image
http://rari.free.fr/cd2.png
That's fantastic! And it looks great :D
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

here is the actual version my game project

https://youtube.com/shorts/SqAT5XEzwjg? ... NTkPqc2raM

I have to optimize the tile engine, actually it's take 0.33 secondes to display the tiles, but it still too slow...
I w like to reach 0.1/1 seconde
User avatar
Dbug
Site Admin
Posts: 4742
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: can't use alternate charset as all standard charset in Lores1

Post by Dbug »

If you share the code somewhere, we can take a look.

There's also this article about performance profiling on the OSDK with the associated sample code showing how to use the profiler.
User avatar
goyo
Pilot Officer
Posts: 65
Joined: Sat Jan 12, 2019 10:16 am

Re: can't use alternate charset as all standard charset in Lores1

Post by goyo »

Dbug wrote: Mon Sep 09, 2024 12:53 pm If you share the code somewhere, we can take a look.

There's also this article about performance profiling on the OSDK with the associated sample code showing how to use the profiler.
Great !! with pleasure, thanks you , i sent to you an access to my project 😀
Post Reply