> programmation de jeux > OSDK issues
3 posts     1 page     
jordan
OSDK padawan
Posted Wednesday, January 2nd 2008 9:42PM
 
3 posts
Hello
and Happy New Year :)

I am doing a game for ORIC Atmos and Pravetz 8D in C and using Oric SDK. Nice tool, but a lot of limitation in the language :(
I am facing some real troubles right now and since i didn't found a way to debug, i am using just code-analysis to find the issues (some help here ?)
One of the suspicious things in my program could be the C stack. I didn't found any information where it is located and how much it is allocated (it is possible to configure it ?). Some help will be appreciated.
Chema
Alpha la vista
Posted Thursday, January 3rd 2008 10:47AM

20 posts

Greetings!

There is nothing like "C debugger", so you have to figure out what is going wrong by using printf's and other tricks. 

In the end, if you want to trace the program at assembly level, you can have a function to make execution stop. Then get to the debugger and trace the prog.

I normally have a _dbug function in asm... something simple like:

_dbug 
.(
         lda #0
dbug  beq dbug
         rts
.)


Then I call dbug() from C. The prog stops with an infinite loop at the beq dbug and I take control from the debugger. Then I simply change the Z flag and start tracing...

The C stack is static, 256 bytes in size and set up at the end of the code. It is defined in the tail.s file (which is included automatically) as
osdk_stack
        .dsb 256

Don't think you have problems with that, unless having something strange or an error like an infinite recursive call.

If you can provide the code that does have problems...

On a side note, I did not find a lot of limitation in the language. I ported a C version of an infocom interpreter and worked perfectly (i used another dev kit, but the capabilities of OSDK are the same IIRC, having the same library). The real problem is that the compiler is crappy and you will get slow and fat code. So for real gaming, you'd better go for some assembly, at least in the key routines.

Cheers.

jordan
OSDK padawan
Posted Thursday, January 3rd 2008 10:02PM
 
3 posts
Thanx for the information.
If the C-stack is 256 bytes, you are right, that the problem is not in eventual overflow. There is no recursion and no deep nesting in my code.

Since it is 3 days since i can not find the problem (and I had the good intention to prepare the game as a New Year gift to Oric community), probably i will seek for some additional eye-look to my code from the forum members soon :)
3 posts     1 page     
> programmation de jeux > OSDK issues