H3 lib

Since we do not have native C compilers on the Oric, this forum will be mostly be used by people using CC65 or the OSDK. But any general C related post will be welcome !
User avatar
rax
Flying Officer
Posts: 193
Joined: Tue Jul 24, 2018 3:16 pm

H3 lib

Post by rax »

Hello :),
A few months ago, out of boredom, I decided to make a small library through which to imitate a screen in lores charset.

I know it's a little pointless, but it was a lot of fun for me.

I use all 80 characters to create a 64 x 60 px screen. The screen can be displayed in more than one place.

If I rewrite the functions of ASM, it will definitely work faster, but I probably won't do it :)

It was a fun project.



source code: https://github.com/raxrax/oricH3OSDK
User avatar
jbperin
Flight Lieutenant
Posts: 480
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: H3 lib

Post by jbperin »

This is great !!

Thank you for sharing this jewel !!
User avatar
kenneth
Squad Leader
Posts: 514
Joined: Fri Nov 26, 2010 9:11 pm
Location: France PdD
Contact:

Re: H3 lib

Post by kenneth »

Nice ! :wink:
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: H3 lib

Post by ibisum »

This looks really nice, I wonder what the effort to add AIC would be like ..
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: H3 lib

Post by Dbug »

ibisum wrote: Mon Oct 12, 2020 10:33 am This looks really nice, I wonder what the effort to add AIC would be like ..
Most probably 100% impossible since it's done using trickery involving ALT CHARSET to create a bitmap window by redefining characters.
AIC requires the ability to change the inverted status per scanline, does not work per character.
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: H3 lib

Post by coco.oric »

Thanks for this dev idea.
It seems that alternate charset is able to produce some nice things
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: H3 lib

Post by Dbug »

coco.oric wrote: Tue Oct 13, 2020 6:11 am It seems that alternate charset is able to produce some nice things
Actually it can do more: Most people assume (by looking at the memory map) that there are only 64 possible ALT CHAR, but there are 96 of them, it's just that the last 32 ones are overlapping with the top of the TEXT video memory... but you can cheat by switching to HIRES at the top of the screen and display some logo or something and then go back to TEXT.

Bam! instant 32 more usable characters :)
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: H3 lib

Post by Chema »

Something similar was done in Oricium, with the difference that it was designed to draw pictures a sets of tiles (characters) not emulating a graphic mode for drawing primitives. Sprites were drawn on specific sets of characters.

There were 40 lines of HIRES at the top, for the Logo/scoreboard, then the full TEXT area with alternating charsets between usual STD and ALT, to get more usable tiles (imposing a restriction on what tiles could be used in odd/even lines to reduce duplicates).

Characters 88 to 96 (both std and alt) were used for shots and 96-127 were used for rendering sprites. Character 32 was an empty tile and the rest were used to render the background stars, the dreadnaughts and other elements.

Then there was a switch back to HIRES at the end of the TEXT screen to get the three lines of text where, in this case, a small graphic area was simulated by using characters to draw the radar (this was possible as character sets in HIRES/TEXT are in different memory areas.

Source: https://es.osdn.net/projects/oricsdk/sc ... m/common.s
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: H3 lib

Post by coco.oric »

There were 40 lines of HIRES at the top, for the Logo/scoreboard, then the full TEXT area with alternating charsets between usual STD and ALT, to get more usable tiles (imposing a restriction on what tiles could be used in odd/even lines to reduce duplicates)
....
Then there was a switch back to HIRES at the end of the TEXT screen to get the three lines of text where, in this case, a small graphic area was simulated by using characters to draw the radar (this was possible as character sets in HIRES/TEXT are in different memory areas.
I remember some tricks you used to sync and get a precise view. I didn't remember these switches, i'll take a look (in my todolist ;))
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
rax
Flying Officer
Posts: 193
Joined: Tue Jul 24, 2018 3:16 pm

Re: H3 lib

Post by rax »

Yes, AIC mode cannot be used. Only 8 pixel segments can be colored vertically (aren't they characters).

Тhe things Debug and Chema said, are pretty good starting points if someone wants to play with alternative characters this way.

I will try to explain to those who do not guess what exactly is happening with these additional characters.
I tried to use all 96 characters, but the additional 16-character definitions are in the text page area (#bb80 - #BC00), this is:
16 * 8 = 128 bytes from the text page
128/40 = 3.2 (4) lines.

The addresses at the beginning of the graphic page (#A000) must be formatted correctly (logo , black screen or something else). It is:
4 text lines * 8 lines per characters in hires mode * 40 characters per line = 1280 bytes.

And it will also not be possible to use these free 4k (#a000 - #b500) for other purposes. Because of this i decided to settle for the available 80 characters.
User avatar
jbperin
Flight Lieutenant
Posts: 480
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: H3 lib

Post by jbperin »

I love this lib very much.

I'm not yet using it as its best but I use it in a project I'm working on.

Belmar2023-02-04-18482268.gif
Belmar2023-02-04-18482268.gif (291.94 KiB) Viewed 1946 times
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: H3 lib

Post by iss »

Very promising! You can even "AIC" it ... ;)
User avatar
jbperin
Flight Lieutenant
Posts: 480
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: H3 lib

Post by jbperin »

Thank you.

I am not sure to see how to "AIC" it.
Is that by inserting color attribute while switching AIC between Hires and text mode ?

Anyway there are already so many things to do with this lib.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: H3 lib

Post by Symoon »

Very nice!
Monochrome is fine too, it gives a "book" feeling ;)
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: H3 lib

Post by ibisum »

Re: AIC, couldn't you combine these techniques with H3 lib and add colour?

Post Reply