CC65 to DSK

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Thu Dec 20, 2018 3:17 pm

Thanks for the rapid answers, I hugely appreciate this amazing level of support!

The bitmap was generated with:

PictConv -f7 -d0 -o2 river256.png river.raw

I managed to get the bitmaps saved on the disk using header.

header river.raw build/river.com $A000

I wrote onto disk together with CC65 code:

tap2dsk -iVIEWER.COM build/viewer.tap build/river.com build/viewer.dsk

Inside viewer (cc65 code) I set the PAPER and INK as follows:

for (y=0; y<100; y++) {
POKE((unsigned char*)(0xA000+((2*y+0)*40)+0), 16); // Black Paper
POKE((unsigned char*)(0xA000+((2*y+1)*40)+0), 16); // Black Paper
POKE((unsigned char*)(0xA000+((2*y+0)*40)+1), 3); // Alternate INK color: Yellow
POKE((unsigned char*)(0xA000+((2*y+1)*40)+1), 6); // Alternate INK color: Cyan
}

But the result is not right, I get the attached picture.
Original looks like this (map river): http://8bit-slicks.com/?page_id=56
Attachments
dump.PNG

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: CC65 to DSK

Post by Chema » Thu Dec 20, 2018 4:30 pm

Not sure if anything went wrong, but for AIC graphics I could only get decent results drawing things by hand.

It is not really a graphic mode, so you need some experimentation to get nice results.

I think it would be easier to develop the game (one phase, for instance) in black and white and then, once things are working, start trying to get AIC mode work.

Sprite drawing routines should be adapted, but that is nearly all, and I am sure some great results can be achieved by adapting the circuit by hand.

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CC65 to DSK

Post by Dbug » Thu Dec 20, 2018 7:02 pm

Oh I see: PictConv is not a magic conversion tool, it just makes it easier to convert stuff that is Oric compliant. It basically automates the placement of invert bits, detecting if something should be ink or paper, etc... but if your picture is not Oric compliant, you will get garbage.

There's a reason why the picture I linked was neatly aligned on multiple of 6, and drawn with actual specific colors on specific blocs of bytes: I paint all my oric graphics on a software that allows me to draw with a 6 pixel wide grid, and I do respect the constraints.

The only "magic" mode is the Sam mode (-f6), but that one is pretty much only usable for static images that don't get modified, like a title picture, because you have zero control on where attributes go.

Generally speaking, that's the philosophie difference between the CC65 and OSDK toolchains, CC65 tries to handle as many things as possible, tries to be as portable as possible, while the OSDK just tries to let you be able to be as efficient as possible on the Oric.

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Thu Dec 20, 2018 11:32 pm

Alright, it makes sense now. I think I will write Python script adapted to the needs of my game.

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Sun Dec 23, 2018 2:43 pm

Short update on the python convertor.

I started by producing a screen with red/blue alternating lines, and then switch [on/off], [normal/inverted] the groups of 6x2 pixels.
That gave me a kind of "palette".

In GIMP, I used cubic interpolation to reduce this palette to 27 colours.

Rescaling my original image to 40x100, I then substitute with the equivalent groups of pixels and get something that "roughly" looks like the original.

Next step will be to sub-divide the groups of 6x2 into groups of 2x2, and get more colour variations within each block.
Attachments
riverAtmos.PNG

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Sun Dec 23, 2018 4:40 pm

I managed to get better detail by going to 2x2 pixel blocks.
Attachments
river2x2.PNG

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Sun Dec 23, 2018 4:45 pm

Still quite rough, but I think I am getting somewhere...
Attachments
menu2x2.PNG

User avatar
peacer
Flight Lieutenant
Posts: 399
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: CC65 to DSK

Post by peacer » Sun Dec 23, 2018 11:14 pm

You can also use Libpipi library / The Pimp program by Cacalabs


Here is a result
Image
8bit.tap
(7.85 KiB) Downloaded 140 times

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Mon Dec 24, 2018 2:36 am

I followed the instructions on this page: http://caca.zoy.org/wiki/libpipi/oric
But I get a garbash screen... Does the file need to be in specific format/size to work with pipi.exe?

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CC65 to DSK

Post by Dbug » Mon Dec 24, 2018 8:57 am

Remember that the libpipi algorithm is also present in pictconv (it's the Sam mode).

romualdl
Officer Cadet
Posts: 52
Joined: Tue Jan 17, 2006 9:42 pm
Location: France

Re: CC65 to DSK

Post by romualdl » Mon Dec 24, 2018 4:34 pm

Possible to do that without modifying that much the source image :

Image
Image

But as Dbug or others said before I definitely think it would be better to modify the source image a bit first to make it more oric-compliant.

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CC65 to DSK

Post by Dbug » Mon Dec 24, 2018 5:29 pm

Yeah, for best results I would remove the background gradient and have the logo use a non-antialiased font.

Generally speaking, vertical color changes are fine, horizontal ones, not that much :)

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Tue Dec 25, 2018 6:55 am

That SAM mode is not bad, once you get the hang of it...

To draw some sprites, I will need to sacrifice a 6 pixel block before and after the sprite, to change atttributes. Is that correct?
(Thus my choice of a black race track...)
Attachments
Sam.PNG

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: CC65 to DSK

Post by Dbug » Tue Dec 25, 2018 9:45 am

The biggest problem with the sam mode is that there is no control about where the attributes are placed, so technically they could be in the middle of your track, with a mix of black ink and black paper, so when drawing the sprites you don't really know which colors to reset to on the right side.

Maybe with some pre-processing of the picture you could move the attributes so they are pushed to the left or right of the track borders?

User avatar
8bit-Dude
Pilot Officer
Posts: 74
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: CC65 to DSK

Post by 8bit-Dude » Tue Dec 25, 2018 10:59 am

Exactly, I am onto it already!
For example, I noticed that some black areas of the map correspond to inverted white paper.
I am trying to push attributes to the edge, as you are suggesting.

Post Reply