Is there any C cross compiler that generates ROM files? (Development Foros MSX)MSX Resource Center            
                       
English Nederlands Espa�ol Portugu�s Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 51 invitados y 6 miembros en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

Development - Is there any C cross compiler that generates ROM files?

Ir a la página ( Página anterior 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 Siguiente página )
Autor

Is there any C cross compiler that generates ROM files?

Huey
msx professional
Mensajes: 672
Publicado: Abril 20 2006, 16:53   
You just lost me.
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 16:57   
Huey
msx professional
Mensajes: 672
Publicado: Abril 20 2006, 17:24   
That should keep me busy for a while.
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 17:31   
FYI my draft table was a Mealy machine, as output
(next action) depends on input (event) and state.

PS
start using type = 0 and define one table at time...
manuel
msx guru
Mensajes: 3637
Publicado: Abril 20 2006, 18:46   
Note that jumps are not sinus movements, but parabolas (gravity is a force, which causes an acceleration according to Newton). Which are a lot faster and easier to compute
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 19:06   
A bugfix

main {
...
if ((kbd & 1)!=0 && feet_on_floor) {dy=4;} 
y = y + dy;
if (!feet_on_floor) 
     {dy = max {-4, dy -1};}
else
     {dy = 0;}
...
}


the jump is height

4 + 3 + 2 + 1 = 10 points
Huey
msx professional
Mensajes: 672
Publicado: Abril 20 2006, 21:44   
@manuel: That's what i meant. I dind knew the english name....

@ARTRAG: What library is max in?

ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 21:45   
Quote:


What library is max in?



any fantasy lib :-)

try this:
#define max(A,B) ( (A) > (B) ? (A):(B)) 



@manuel
About falling, my solution approximates very well a parabola,
as the 2nd order derivate is constant and equal to -1
(except for the fact that max speed is limited to -4, in
this case the 2nd order derivate is 0, but can
be interpreted as attrite).

Huey
msx professional
Mensajes: 672
Publicado: Abril 20 2006, 22:23   
@ARTRAG: fantasy.lib

The jump isn't very high. I'll experiment with it this weekend.

I'm must say it's getting rather mathematical. Thats not my biggest talent I thought it would be more about 'tricks' than FSM and stuff. But its real interesting. I vagely remember Mealy and sorts during my study but I had some other interests back then
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 22:36   
About FSM, do not worry, things are much simpler that they seem
Go ahead and you'll see yourself


About jumping higer, try
main {
...
if ((kbd & 1)!=0 && feet_on_floor) {dy=5;} 
y = y + dy;
if (!feet_on_floor) 
     {dy = max {-5, dy -1};}
else
     {dy = 0;}
...
}

this gives
5 + 4 + 3 +2 +1 = 15 points
Huey
msx professional
Mensajes: 672
Publicado: Abril 20 2006, 22:48   
Shouldn't it be: y = y - dy?
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 20 2006, 23:00   
Correct! I get confused as screen y are inverted
wrt the standard cartesian plane. Try:
main {
...
if ((kbd & 1)!=0 && feet_on_floor) {dy=-5;} 
y = y + dy;
if (!feet_on_floor) 
     {dy = min {5, dy +1};}
else
     {dy = 0;}
...
}


naturally
#define min(A,B) ( (A) > (B) ? (B):(A)) 

AuroraMSX

msx master
Mensajes: 1278
Publicado: Abril 21 2006, 13:38   
Quote:

Correct! I get confused as screen y are inverted
wrt the standard cartesian plane. Try:
main {
...
if ((kbd & 1)!=0 && feet_on_floor) {dy=-5;} 
y = y + dy;
if (!feet_on_floor) 
     {dy = min {5, dy +1};}




I think that using ( and ) rather than { and } around the parameters of min will reduce the number of syntax errors with at least one
ARTRAG
msx master
Mensajes: 1802
Publicado: Abril 21 2006, 13:43   
hit!
Huey
msx professional
Mensajes: 672
Publicado: Abril 21 2006, 14:09   
Is there an alternative for using fgetc() and fgets()? Seems this is not supported by HITECH

I wanted to load the binairy .stg file from vscreen (copy paste with hex-editor is getting irritating).
 
Ir a la página ( Página anterior 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 Siguiente página )
 







(c) 1994 - 2009 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation