¿Por qué no trabaja esta escritura en PS2?

Started by Joypad, October 17, 2013, 03:12:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joypad

Esta escritura simple funciona correctamente en el Windows y Linux. Esto muestra una flecha que se mueve a través de la pantalla.

Esto no funciona correctamente en el PS2. La flecha permanece estática y no se mueve. ¿Por qué?


English:
Why does this script not work on the PS2?

This simple script functions correctly on Windows and Linux. It shows an arrow moving across the screen.

It does not function properly on the PS2. The arrow remains static and does not move. Why?

// On PC, it shows arrow moving across the screen
// On PS2, the arrow does not move. Why?

import "mod_text";
import "mod_grproc";
import "mod_video";
import "mod_map";
import "mod_screen";
import "mod_timers";
import "mod_sys";
import "mod_proc";
import "mod_key";
import "mod_draw";
IMPORT "mod_joy";
IMPORT "mod_time";

global
int myarrow;
end

process main()
begin
set_mode(320,240,32);

    myarrow = load_png("arrow.png");
dpadarrow(100,100);

repeat

frame;
until ( key(_esc) )

let_me_alone();


end

PROCESS dpadarrow(int x, int y)
begin
graph = myarrow;

loop

if ( x < 320 ) x = x + 2; end
if ( x > 319 ) x = 0; end

frame;
end //loop
end

FreeYourMind

until ( key(_esc) )

Ps2 is a console, don't have leyboard, you must replace _esc with a joypad button mapper

Joypad

Quote from: FreeYourMind on October 17, 2013, 09:02:33 PM
until ( key(_esc) )

Ps2 is a console, don't have leyboard, you must replace _esc with a joypad button mapper

I took the key( _esc) out but that didn't fix it. The Playstation 2 supports USB keyboard and mouse so it's OK to use key(_esc)

After a lot of experimenting, I discovered the problem turned out to be caused by not using set_mode flags. Setting certain flags fixed it from freezing. eg


//This will work on PC but freeze on PS2:
set_mode(320,240,32);

//Setting these mode flags will cure the freezing problem on PS2:
set_mode(320,240,32, MODE_DOUBLEBUFFER | MODE_HARDWARE | DOUBLE_BUFFER | HW_SURFACE | MODE_WAITVSYNC);