Page 1 of 2

A little sprite-demo (textmode)

Posted: Wed Feb 24, 2010 3:06 pm
by Nox
Hello, Hola, Hallo,

this is my first post, and my first little program/demo for the oric.
In fact, a few weeks ago I didn't know there is something like an oric...
but I know a bit about the C64, so many things are quite familiar.

So here it is:
Image
Well, there's not so much to see on that still image... but maybe you try it nevertheless:
spritedemo.tap

Features:
- Textmode
- Background is black/white, can use 32 chars
- 4 softscrolling sprites, 18 x 16 pixel, black/white/transparent (using 48 chars, less when overlapping)
- drawing alternating in both charsets to reduce flicker
- Sprites have an z-order and can overlapp

missing yet:
- no collision detection
- sprites can not leave (partially) the screen
- not 100% assembler, and could be optimized in speed and memory-usage
- still some flickering, obviously because I know nothing about interrupts and vsync-detection on the oric...
- technically, sprites could be 1 pixel larger in each direction (19 x 17)

If you switch the background on, you can see how the screen-update-mechanism works.
That is intended of course, could also update the whole screen at once.
Hope you like it.
And thanks to Twilighte for all the help!

Re: A little sprite-demo (textmode)

Posted: Wed Feb 24, 2010 4:13 pm
by Xeron
Nox wrote:this is my first post, and my first little program/demo for the oric.
Great! Nice to see a new face. I'm no longer the new boy ;-) (are you using Euphoric or Oricutron for development, btw? or maybe mess?)
- still some flickering, obviously because I know nothing about interrupts and vsync-detection on the oric...
Then you already know everything there is to know about vsync detection on the oric, sadly.

Posted: Wed Feb 24, 2010 4:26 pm
by Xeron
Hey thats a pretty cool animation at the start there! Nice work!

Posted: Wed Feb 24, 2010 7:07 pm
by Dbug
Nice start, that's already more Oric code than many people :)

Posted: Wed Feb 24, 2010 7:21 pm
by Chema
Indeed pretty cool animation! And good smooth sprites!

Certainly much better than most Oric's software back in the 80's... or shall I say all software from that era.

Welcome abroad!

Posted: Thu Feb 25, 2010 12:23 pm
by Nox
Thank you all!

I use euphoric, haven't tried another one. Are there big differences?

Posted: Thu Feb 25, 2010 12:29 pm
by Dbug
Euphoric was the de facto standard in terms of Oric emulators, but it has become more and more difficult to use on recent operating systems, and it works only on DOS compatible environments.

Recently Xeron has been working on Oricutron, a portable, next generation Oric emulator. It's still rough on the edges here and there, but it's definitely very usable, and ports of it runs on Windows, Beos, Amiga OS4 and Linux (more to come).

You can find the Oricutron project here: http://code.google.com/p/oriculator

For the development, what did you use to create your program?

Posted: Thu Feb 25, 2010 4:00 pm
by Nox
I program in Delphi on Windows.
Besides that, I only use an Editor (pspad) for C/asm and MS-Paint (yes...) for graphics.
For more advanced graphic-operations (sprite-rotation etc.) I usually write an own program/editor in Delphi.

Never managed to become friends with a "modern" graphic program, last one I mastered was DeluxePaint V on amiga :-)

Posted: Thu Feb 25, 2010 4:14 pm
by Dbug
I was more asking about which tools you used to do the oric program itself, is the code in BASIC, C, assembler, and if yes which C/assembler have you been using, and how did you converted the graphics to something the Oric can use.

Did you use some cross compilers/assemblers, or what it done directly on the Oric by entering lines of DATA in a basic program?

Posted: Thu Feb 25, 2010 5:02 pm
by Nox
Ah, I see. I just downloaded and use the osdk from this website.
I first code in C, and then translate the critical parts bit by bit to assembler.

Grafics and all other data are just many many lines of
.byt 1,2,3,4...
generated by a delphi-prg and inserted manually in the assembler-file.

Posted: Thu Feb 25, 2010 5:52 pm
by Dbug
Ok, so if you are using the osdk, you could as well use PictConv to create the data :)

Check the sample\c\hires_picture folder in the OSDK directory.

osdk_makedata.bat calls pictconv to generate a "picture.s" file from "picture.png".

Posted: Thu Feb 25, 2010 6:49 pm
by ibisum
This is brilliant, and inspiring me to do a bit of demo code too ..

But perhaps there is an interesting bug with Oricutron here? I press the 1/2/3/4 keys and not much happens - only 1 seems to turn off the box and turn it back on again - what are the other keys supposed to do? If I rapidly hit 1 2 3 4, also, the app stops and i get to the BASIC prompt .. ?

Posted: Thu Feb 25, 2010 6:58 pm
by Xeron
ibisum wrote:But perhaps there is an interesting bug with Oricutron here? I press the 1/2/3/4 keys and not much happens - only 1 seems to turn off the box
The 1/2/3/4 keys work perfectly in Oricutron on windows and os4 for me?

Posted: Thu Feb 25, 2010 7:45 pm
by Chema
I tried it and indeed they work under oricutron 0.5 and windows XP.

There is a problem with bouncing, however, so the sprite might turn on/off very quickly many times.

How are you reading the keyboard?

Posted: Fri Feb 26, 2010 1:17 am
by Nox
Yes, I check the keyboard every single frame (and switch the sprites 1-4 on/off if the corresponding key is pressed).
Of course that is not a good solution for this type of switch...
will do better next time :oops:

And I use a slightly modified version from this example
http://www.defence-force.org/computing/ ... /index.htm

Had some troubles with it, but maybe it's just my keyboard
(I know that keyboards have some kind of matrix too, and cannot handle every combination of keys pressed).
So my solution was to first check the cursor-keys, and only if none is pressed I check the other ones...
Dbug wrote: Check the sample\c\hires_picture folder in the OSDK directory.

osdk_makedata.bat calls pictconv to generate a "picture.s" file from "picture.png".
Well, that makes sense, to store the images in separat files.
Haven't explored all the tools yet...