A little sprite-demo (textmode)

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
Nox
Officer Cadet
Posts: 36
Joined: Wed Feb 24, 2010 2:49 pm
Location: Berlin
Contact:

A little sprite-demo (textmode)

Post by Nox » Wed Feb 24, 2010 3:06 pm

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!

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: A little sprite-demo (textmode)

Post by Xeron » Wed Feb 24, 2010 4:13 pm

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.

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron » Wed Feb 24, 2010 4:26 pm

Hey thats a pretty cool animation at the start there! Nice work!

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

Post by Dbug » Wed Feb 24, 2010 7:07 pm

Nice start, that's already more Oric code than many people :)

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

Post by Chema » Wed Feb 24, 2010 7:21 pm

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!

User avatar
Nox
Officer Cadet
Posts: 36
Joined: Wed Feb 24, 2010 2:49 pm
Location: Berlin
Contact:

Post by Nox » Thu Feb 25, 2010 12:23 pm

Thank you all!

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

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

Post by Dbug » Thu Feb 25, 2010 12:29 pm

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?

User avatar
Nox
Officer Cadet
Posts: 36
Joined: Wed Feb 24, 2010 2:49 pm
Location: Berlin
Contact:

Post by Nox » Thu Feb 25, 2010 4:00 pm

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 :-)

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

Post by Dbug » Thu Feb 25, 2010 4:14 pm

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?

User avatar
Nox
Officer Cadet
Posts: 36
Joined: Wed Feb 24, 2010 2:49 pm
Location: Berlin
Contact:

Post by Nox » Thu Feb 25, 2010 5:02 pm

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.

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

Post by Dbug » Thu Feb 25, 2010 5:52 pm

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".

User avatar
ibisum
Squad Leader
Posts: 837
Joined: Fri Apr 03, 2009 8:56 am

Post by ibisum » Thu Feb 25, 2010 6:49 pm

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 .. ?

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron » Thu Feb 25, 2010 6:58 pm

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?

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

Post by Chema » Thu Feb 25, 2010 7:45 pm

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?

User avatar
Nox
Officer Cadet
Posts: 36
Joined: Wed Feb 24, 2010 2:49 pm
Location: Berlin
Contact:

Post by Nox » Fri Feb 26, 2010 1:17 am

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest