Pseudo pixel game prototype.

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: 160
Joined: Tue Jul 24, 2018 3:16 pm

Pseudo pixel game prototype.

Post by rax »

After making the font, i decided to try if it could also be a game with these 16 characters.
it's just a prototype, I don't know if it will become a finished game

Here is the result:

Sprites:
sprites.png
sprites.png (11.4 KiB) Viewed 2241 times

Level:
levelMap.png

Code:
https://github.com/raxrax/oricOsdkPseudoPixelsGame

Game:
alt4x4GameProto.tap
(8.99 KiB) Downloaded 29 times
User avatar
ibisum
Wing Commander
Posts: 1568
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Pseudo pixel game prototype.

Post by ibisum »

At first I was like, "wtf rax, you turned my Oric into a ZX81" but then I was like .. 'but you could add colour!' :)

Cute graphics, neat engine and some interesting potential .. curious to see about that colour, though.
User avatar
rax
Flying Officer
Posts: 160
Joined: Tue Jul 24, 2018 3:16 pm

Re: Pseudo pixel game prototype.

Post by rax »

Yes! The desired effect was close to the ZX81.

Here's a pathetic attempt at coloring. I think it can be a hundred percent better, but it needs a lot of work .
(there are also glitches that I couldn't easily fix).
Attachments
alt4x4GameProtoColor.tap
(9.87 KiB) Downloaded 24 times
User avatar
ibisum
Wing Commander
Posts: 1568
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Pseudo pixel game prototype.

Post by ibisum »

Well, it ain't no SWIV, but its surely something that I could see evolving to be a very playable shooter... whats with the top-line character mess, though?
User avatar
rax
Flying Officer
Posts: 160
Joined: Tue Jul 24, 2018 3:16 pm

Re: Pseudo pixel game prototype.

Post by rax »

ibisum wrote: Tue Nov 08, 2022 11:08 am Well, it ain't no SWIV, but its surely something that I could see evolving to be a very playable shooter... whats with the top-line character mess, though?
Top-line character is a glitch. I didn't have time to fix it.

I'll never be able to do anything like SWIV. I had started something similar and never finished it.
User avatar
jbperin
Flight Lieutenant
Posts: 457
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Pseudo pixel game prototype.

Post by jbperin »

Thank you very much Rax for the realease of this source code.

As usual with your code I find it is neat, inspiring and so smartly designed that it is enjoyable to read.

Big Up !!

I made a little screencap of the color version with my new friend the Oric 2.5 animated gif feature :
2022-12-22-09420068.gif
2022-12-22-09420068.gif (246.17 KiB) Viewed 797 times
applepie
2nd Star Corporal
Posts: 23
Joined: Thu Dec 15, 2022 4:53 pm

Re: Pseudo pixel game prototype.

Post by applepie »

Very very cool demo ! So 8bitish ;-)

There's magic in LORES 1, might inspire me !

What tool did you use to convert the png files to .c data (https://github.com/raxrax/oricOsdkPseud ... ster/res.c) ?
User avatar
jbperin
Flight Lieutenant
Posts: 457
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Pseudo pixel game prototype.

Post by jbperin »

applepie wrote: Fri Dec 23, 2022 6:38 pm
What tool did you use to convert the png files to .c data (https://github.com/raxrax/oricOsdkPseud ... ster/res.c) ?
I don't know what tool master rax used to convert PNG into .c array. But I can show you some similar things written in Python.

https://github.com/oric-software/castor ... ure2buf.py

With the code generator being here:

https://github.com/oric-software/castor ... codegen.py

If ever it can help.
User avatar
coco.oric
Squad Leader
Posts: 706
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: Pseudo pixel game prototype.

Post by coco.oric »

on my side, i've discover this lores mod with Rax post.
Then going deeper on the subject, based on std alt set, i've created an excel file to draw a lores pic, and generate some basic lines & c description of the screen
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
User avatar
jbperin
Flight Lieutenant
Posts: 457
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Pseudo pixel game prototype.

Post by jbperin »

In case it can help, I had made a little tool to generate alternate charset from images.

It take an area from a black and white image in 240*224 pixel and create a charset to reproduce this image (and optimize the chaset size by reusing already defined characters).


The generated C code uses this function that changes an alternate character in the Oric memory:

Code: Select all

void change_char(char c, unsigned char patt01, unsigned char patt02, unsigned char patt03, unsigned char patt04, unsigned char patt05, unsigned char patt06, unsigned char patt07, unsigned char patt08) {
    unsigned char* adr;

    adr      = (unsigned char*)(0xb800 + c * 8);
    *(adr++) = patt01;
    *(adr++) = patt02;
    *(adr++) = patt03;
    *(adr++) = patt04;
    *(adr++) = patt05;
    *(adr++) = patt06;
    *(adr++) = patt07;
    *(adr++) = patt08;
}
And here's the python script that create an alternate character from a preformatted image and generates the code to put the alternate charset in the memory and displays the image on the screen.
extractAltCharset_example.zip
(4.81 KiB) Downloaded 12 times
From an image below (240*224 px to match Oric screen dimension):
chateau.png
chateau.png (431 Bytes) Viewed 546 times
it generates the code:

Code: Select all

void screen() {
change_char(33 , 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
change_char(34 , 0x0, 0x0, 0x1, 0x3, 0x6, 0xb, 0x18, 0x14);
... Long list of character definition
change_char(61 , 0x0, 0x10, 0x18, 0x2e, 0x1e, 0x1e, 0xc, 0x0);

*((unsigned char *)LORES_SCREEN_ADDRESS+0*40+2)=33;
*((unsigned char *)LORES_SCREEN_ADDRESS+0*40+3)=33;
... Long list of screen writing
*((unsigned char *)LORES_SCREEN_ADDRESS+4*40+11)=33;
}
If it can help ....
User avatar
jbperin
Flight Lieutenant
Posts: 457
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Pseudo pixel game prototype.

Post by jbperin »

But the most stunning stuff I have ever seen about the alternate charset is master rax's H3 LIB

https://forum.defence-force.org/viewtopic.php?t=2186

Dynamically changing alternate charset to create a graphical area within text screen .. just amazing ..
User avatar
iss
Wing Commander
Posts: 1529
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Pseudo pixel game prototype.

Post by iss »

applepie wrote: Fri Dec 23, 2022 6:38 pmWhat tool did you use to convert the png files to .c data ...
The right answer here is pictconv from OSDK ;).
User avatar
jbperin
Flight Lieutenant
Posts: 457
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Pseudo pixel game prototype.

Post by jbperin »

User manual of Pictconv is here.
User avatar
Dbug
Site Admin
Posts: 4230
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Pseudo pixel game prototype.

Post by Dbug »

jbperin wrote: Wed Dec 28, 2022 9:00 am But the most stunning stuff I have ever seen about the alternate charset is master rax's H3 LIB

https://forum.defence-force.org/viewtopic.php?t=2186

Dynamically changing alternate charset to create a graphical area within text screen .. just amazing ..
It's similar to what we did in Barbitoric



Basically, each time you see the same effect duplicated on the screen, it's most probably using charsets reconfiguration instead of HIRES
User avatar
Symoon
Archivist
Posts: 2210
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Pseudo pixel game prototype.

Post by Symoon »

... And with Metromov lonnnnng ago ;)
https://www.oric.org/software/metromov-2480.html
Post Reply