Doing 3D games on the Oric ?

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Greetings again.

I have been working on the universe generator, and I now have a first attempt to recreate the galactic charts (long and short range). It is still quite primitive (no title, no cursors...), but the general algorithms work correctly for displaying, which is the important thing.

Here is an screenshot of the short range chart
Image

The long-range chart does not fit in the screen (needs 254 pixels in wide), so maybe scrolling will be necessary :(

The generator is in a different program currently, as merging it with the other may need to activate overlay ram (maybe not, but it will be quite close), but it is there and mainly works. Once I have set up a couple of things I will try to do the merging...

The sources are in the Universe folder in the svn repository.

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

Post by Chema »

Some more small advances, which (may) deserve a progress report.

I have been working on the charts and I think I got nearly all the system working but buying/selling on the markets (need to think about the interface), equipment and other minor things.

About the charts, here you can see a screenshot of the short range chart. You can use the small cursor to select a planet (it snaps to the closest one when you press SPACE). I am using the ROM to draw the circle, but this should be changed once this code is merged with the rest.
Image

The long chart also works. In this case you can alternatively search for a planet giving its name as well as using the cursor. Here I searched for Qube:

Image

The galactic chart can scroll (not smooth-scroll, simply redraws the othe part of the galaxy, but this works ok in this scenario). You can see the small arrows, showing this. The scroll occurs when you hit the border with the cursor.

Also the galactic hyperspace is working, so you can browse the complete 8 galaxies. Have a look:
Image

This might seem quite simple, but it was not. Anyway it seems to be working correctly now.

I need to write an text (and number!) input routine, to avoid using the C scanf function and the ROM. This includes a kind of atoi function.

This reminds me that managing the keyboard is not going to be trivial (at least not for me!). I am not sure what could be the correct way to go. Some keys should be read only in certain situations, so it might be worth it to have more than one routine, depending on the screen you are.

In some cases, like inputting text, I suppose reading the keyboard could be done inside the main code, not by the interrupt routine, so (nearly) all the keyboard is scanned.

Some keys should be tested quickly to check if they are kept pressed (for moving the cursor, for instance) while others should be read just once (with no bouncing), for instance to access screens like the market or so.

In addition I will need to check for several simultaneous keypresses (storing them as bits inside a byte for instance), mostly when piloting your ship.

These are not really difficult tasks, but I am not sure which is the best way to organize them, so any advice would be highly appreciated (those Oric's Masters out there?).

Any comment/advice/suggestion is appreciated, as usual.

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

Post by Dbug »

The screens with maps looks very nice :)

For the keyboard, what I would do is to use 8 bytes to store the status of the keyboard matrix, and some irq routine to update the state of the matrix with a fast matrix scan routine (it does not have to scan all the rows each interruption, it could update one each time, so in 8 irq you get a full update).

With that you can easily have any of your code check if this or this key is pressed by just checking the bits in the "matrix".

On top of that, if you want to handle keyboard inputs like for entering text, then you can add some code that detects the transitions. For that you can use an additional matrix that contains the result of the previous frame. (you can either flip-flop the pointers, or recopy the 8 bytes - probably the easiest). You can check the transitions from one state to another just by EORing the two of them.

Does that make sense ?
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

It makes A LOT of sense indeed. I need to learn how to handle the keyboard scanning, but (unless any other idea arises) I will try to implement that.

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

Post by Chema »

Greetings again.

As I had some free time (don't know when I will have anymore), I made a small progress.

Now market fully works. You can buy & sell items in different planets and make your cash.

Here is an screenshot of the market screen, buying food and textiles in Lave.
Image

Credits are stored as a 32-bit variable, so had to make some routines to handle these. I tested with an initial cash of 20 MCr and it worked.

You just select the market item and use a couple of keys to buy and sell, while the quantities, space cargo and cash are updated accordingly. I think this is much easier than the system used in the Spectrum (at least) version.

Need to add buying and selling (maybe just buying for now) equipment and also a screen with a summary of your status, cash, hyperspace system and so on, and I think this part will be completed.

Of course there is a part of code written in C (keyboard choices and minor things), which should be translated into asm, so we can shrink the code size. I think it will be over 8K, which is quite big IMHO. I think I trend to write fat code :(

Don't know if there is any interest in the community for this project, but I am having a lot of fun and learning many things, so I can bet it will be completed.

Cheers
User avatar
Symoon
Archivist
Posts: 2311
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Post by Symoon »

Chema wrote:Don't know if there is any interest in the community for this project, but I am having a lot of fun and learning many things, so I can bet it will be completed.
Well, count me in the interested people.
There's so little spare time and so many things to do on the Oric that I never manage to focus on one specific project, but that doesn't mean I don't care :)

Keep up the good work, it seems really nice and it's amazing.
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

Chema keep up the good work, it looks fantastic. I am much interested in your Oric projects, actually my nearly 6 yo son loves Space 1999! We play every other day. Thank you :D
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Thanks for your replies...

I am not sure how far I will get in this project, as it is more some kind of experiment, but also was NOISE and we ended up with Space:1999 so who knows...

In the meantime anyone wanting to help is welcomed. There are many small routines that need to be done, so if you want to add your small piece of code, just let me know :)

Some examples:
- Keyboard scanning
- Text formatting (to avoid the planet description to cut words when the end of line is reached). This should be as small as possible, use little memory and it would be perfect if it can justify text :)
- Hyperspace sequence. Can do something similar to other Elites and draw some circles, but I guess if something better can be done with the Oric, maybe playing with some attributes to add color...
- Alternate design for the cockpit and radar
...

Cheers
jede
Flying Officer
Posts: 191
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Post by jede »

Hello,

Chema, your games are really impressive.

Space99 is really good.

As soon as i'll get my telestrat video cable, i'll try on my real telestrat :)
User avatar
Silicebit.
Flight Lieutenant
Posts: 313
Joined: Thu Jan 12, 2006 10:18 pm
Location: Madrid, Spain
Contact:

Post by Silicebit. »

Don't know if there is any interest in the community for this project, but I am having a lot of fun and learning many things, so I can bet it will be completed.

Chema, Espacio1999 es un excelente trabajo, de vez en cuando me echo unas largas partidas y estoy encantado con el juego. Estoy seguro que Elite sera otro trabajo excelente.

¿Que necesitas saber sobre el escaneo del teclado?. (escribeme a burrosoft[AT]terra[DOT]es).


Chema, your job is excellent, I'm enjoying Space1999 very much. I be sure that Elite will be other excellent work.

What do you want to know about of keyboard scanning?.
User avatar
Symoon
Archivist
Posts: 2311
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Post by Symoon »

Chema wrote:- Keyboard scanning
I recall Micr'Oric issue 6 had a very good article about it (in my beginner's opinion) from Fabrice Broche, the French guru of the Oric in the 80's. It's on pages 10 to 19.
You can download it from oric.org:
http://www.oric.org/index.php?page=ress ... etail&id=2

Of course it's in French but I think assembler code can be read from any country ;)
Hope this helps.
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Silicebit. wrote:¿Que necesitas saber sobre el escaneo del teclado?. (escribeme a burrosoft[AT]terra[DOT]es).
Will email you soon about this. In summary I just don't know how to read the keyboard. There are many docs around (some of them posted in these threads -- I think Twilighte posted one), but they are not easy to follow for me!

Maybe I just need to dedicate more time to this, but I have not much spare time currentlt :(

Thanks for all your posts of support. They mean a lot to me.

Did not want to sound as just ranting. Usually you find several Elite-fans and gurus around, who rise hands as soon as you mention it, and I found it strange that this did not happen here...

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

Post by Dbug »

When Twilighte get his new internet access up and running, I believe he will be able to help you with the keyboard management :)
JamesD
Flight Lieutenant
Posts: 358
Joined: Tue Nov 07, 2006 7:38 am

Post by JamesD »

Symoon wrote:
Chema wrote:- Keyboard scanning
I recall Micr'Oric issue 6 had a very good article about it (in my beginner's opinion) from Fabrice Broche, the French guru of the Oric in the 80's. It's on pages 10 to 19.
You can download it from oric.org:
http://www.oric.org/index.php?page=ress ... etail&id=2

Of course it's in French but I think assembler code can be read from any country ;)
Hope this helps.
I typed in part of the code. Someone else can translate and finish if needed. I got to page 14.
I can't guarantee all labels line up since they didn't quite line up on the scans and I don't know French.

Code: Select all

	ORG	$400
	PHP
	SEI			; Supprimer la gestion normale.
	LDA	%#00
	STA	#00		; 00 pointeur des colonnes
	LDX	%#7F
@C	TXA			; premiere colonne activee No 7
	PHA			; Sauvegarder masque colonne dans la pile.
	LDA	%#0E
	STA	#030F
	LDA	%#EE
	STA	#030C
	STX	#030F
	LDA	%#EC
	STA	#030C
	LDA	%#CC
	STA	#030C		; Activation colonne.
	LDY	%#00		; Y contient le 'DESSIN' d'une colonne.  0 au debut.
	LDX	%#07		; Boucler sur toutes les lignes.
@B	TXA
	ORA	%#10		; Ne pas activer l'imprimante.
	STA	#0300		; Activation.
	LDA	%#08
	BIT	#0300		; et test de la ligne.
	BEQ	@A
	TYA			; Si connectee
	ORA	#F8,X
	TAY			; Actualiser 'DESSIN' d'une colonne.
@A	DEX
	BPL	@B		; Boucler sur les lignes
	LDX	#00		; X= No colonne.
	INC	#00		; Incrementer colonne.
	STY	#04,X		; Et sauver 'DESSIN' colonne actual le.
	PLA			; Restaurer masque colonne.
	SEC			; Permutation circulaire d'un cran a droite.
	ROR	A
	TAX			; et passage a la colonne suivante.
	BCS	@C		; Si un '0 sort - c'est la fin.
	PLP
	LDA	%#1E		; AFFICHAGE
	JSR	#CCD9		; #CC12 sur ORIC 1
	LDX	%#07		; Curseur en haut a gauche.
@E	LDY	%#07
@D	ASL	#04,X
	BCC	@F+1		;#045B  ????
	LDA	%#30
@F	BIT	#31A9
	JSR	#CCD9		; #CC12 sur ORIC 1
	DEY
	BPL	@D
	JSR	#CBF0		; #CB9F sur ORIC 1
	DEX
	BPL	@E
	RTS
;0470
	LDX	#01
	LDA	%#FF
	CLC
@G	ROL	A
	DEX
	BPL	@G
	TAX
	LDA	%#0E
	JSR	#F590		; #F535 sur ORIC 1
	LDA	#00
	STA	#0300		; Activation de le colonne contenue en 1.
	LDA	%#08		; Demande de tester la ligne contenue en 0.
	AND	#0300
	STA	#02		; Si la ligne et la colonne sont connectees - Bit 3=1
	RTS
;0490
	PHP
	SEI			; Pour que la gestion normale ne gene pas.
	JSR	#D8CB		; #D810 sur ORIC 1
	TXA			; Z contient l'operande de USR
	AND	%#38		; Les bits 3-4-5 contiennent la ligne
	LSR	A		; on les isole.
	LSR	A
	LSR	A		; et on les deplace dans les bits 0-1-2
	PHA			; puis on les sauve sur la pile.
	TXA
	AND	%#07		; Recuperer la colonne.
	TAX
	CLC
	LDA	%#FF		; Demultiplexage de la colonne.
@H	ROL	A
	DEX
	BPL	@H
	TAX			; Dans X.
	LDA	%#0E
	JSR	#F590		; #F535 sur ORIC 1
	PLA			; Activation colonne.
	ORA	%#10		; Ne pas activer le STROBE imprimante
	STA	#0300		; mais... activer le demultiplexeur.
	LDA	%#08		; Masque de TEST + temps de reponse.
	PLP
	BIT	#0300
	BEQ	@I		; Si connectee... faire
	JMP	#DF0F		; un TRUE (-1)
@I	JMP	#DF0B		; sinon un FALSE (0)
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Dbug wrote:When Twilighte get his new internet access up and running, I believe he will be able to help you with the keyboard management :)
Sure! I am sure he is quite busy with his own projects, but I will need his expertize sooner or later :)

Thanks for the code JamesD, but I am in need of understanding how to do all this, so have still to read the docs and study them :(

Anyway I have made a first attempt to merge everything into one single program and the end resulted in something very buggy but more or less working, so it is good news!

The merged size is 37863 bytes, quite near the limit. Some ROM routines seem to fail and there are strange bugs here and there, but it is all togheter!

A lot of cleaning has yet to be done, so it is not as bad as it might seem. However no doubt we will need to go with the overlay ram if we want to have some extras (like music).

Cheers
Post Reply