DavidBeoulve
GP2X by EvilDragon OC's to 280-300MHz
I can't believe I've spent all Sunday morning on this *chuckles* but there ain't much in the way of documentation.
Here is what I have found that is useful:
Using as a base what Danko posted here, I have labored to produce...
CODE
program AMERYTH; // you can omit this if you want
// Global variables
global
int g_Hero;
int g_Bg;
int g_Icon;
int m_Athena;
int g_Border;
int exit;
end
Self explanatory. Ameryth is copyright. The "G_" variables are integers that will store the number of a graphic so they can be referred to by name.
CODE
// Main process (entry point)
begin
// Sets the graphic mode to 320x240, 16bpp, windowed
set_mode(320, 240, 16);
// FPS and maximum auto frameskip
SET_FPS(50,10);
// Load graphics. Load_XXX function return an int value
// which can be used later to refer to loaded resources
g_Hero = load_png("PNGs_320x240_max_WB\PNG_swordman3.png");
g_Bg = load_png("PNGs_Backgrounds\bg.png");
g_Icon = load_png("PNGs_Utility\base.fpg");
g_Border = load_png("PNGs_Utility\border_exact.png");
//Set the Icon up
set_icon(0,g_Icon);
Here the rendering mode is set, and that works. The graphics are loaded, and that works. The ICON thing doesn't work.
CODE
//Set up background Music
m_Athena = LOAD_SONG("Music\Athena.ogg");
PLAY_SONG(m_Athena,0);
Quiest mentioned using MP3's, then everyone at Boolean Soup started playing Alphabet Soup with his post, and I have no idea how he did it.
CODE
// Put a background image
put_screen(0, g_Bg);
Apparenty this is an important difference from other, hitherto unknown methods of pasting graphics on the screen.
CODE
// Call the hero process
hero();
// Call the Status Process
status_screen();
Fenix uses multithreading of some kind, I think; at least it uses separate processes. Anyway, HERO is one process, and STATUS_SCREEN the other. Case in names doesn't seem to matter.
CODE
write(0,160,160,4,"Press [Start] To Start ");
I just put the the text in to see what that looks like - it's a very big font, but specifying a font other than "0" (the first number) doesn't work... how do I get more fonts?
CODE
// Main loop
repeat
frame;
until (key(_esc))
// Destroy all running processes
let_me_alone();
// Unload resources
unload_map(0, g_Hero);
unload_map(0, g_Bg);
unload_map(0, g_Icon);
unload_map(0, g_Border);
end
That main loop runs the program - since each process is responsible for looping itself. Everything else is clean-up as the program closes.
CODE
// This is the process of our hero. It controls
// it movement with keyboard
process hero()
begin
graph = g_Hero;
x = 320/2;
y = 240/2;
loop
if (key(_right)) x+=1; end
if (key(_left)) x-=1; end
if (key(_up)) y-=1; end
if (key(_down)) y+=1; end
frame;
end
end
This works just fine, for what it is. Eventually I'll be doing something completely different.
CODE
process Status_Screen()
begin
DRAWING_COLOR(12);
DRAW_BOX(10,10,100,40);
end
I have tried loading a dithered PNG (every other pixel is transparent) but it always turns up GREEN. The (opaque) colored pixels, be they black or blue, turn green (which is the predominant color of the background image. But transparency works. Exporting this in different PNG formats, or even putting it inside an FPG using FPG EDIT (Fenix's image packer/editor) doesn't change this. HUH?
Basically, I need to set up a status screen for your typical RPG - where you see your character's status bars at the bottom and there's some enemy in front of you. I can ungay that later once you see the finished product, but for now it will sound like it just came out of a California parade.
Any and all help is appreciated. Here's the code again - simply comment out the music and change the PNGs to load whatever you want.
CODE
program AMERYTH; // you can omit this if you want
// Global variables
global
int g_Hero;
int g_Bg;
int g_Icon;
int m_Athena;
int g_Border;
int exit;
end
// Main process (entry point)
begin
// Sets the graphic mode to 320x240, 16bpp, windowed
set_mode(320, 240, 16);
// FPS and maximum auto frameskip
SET_FPS(50,10);
// Load graphics. Load_XXX function return an int value
// which can be used later to refer to loaded resources
g_Hero = load_png("PNGs_320x240_max_WB\PNG_swordman3.png");
g_Bg = load_png("PNGs_Backgrounds\bg.png");
g_Icon = load_png("PNGs_Utility\base.fpg");
g_Border = load_png("PNGs_Utility\border_exact.png");
//Set the Icon up
set_icon(0,g_Icon);
//Set up background Music
m_Athena = LOAD_SONG("Music\Athena.ogg");
PLAY_SONG(m_Athena,0);
// Put a background image
put_screen(0, g_Bg);
// Call the hero process
hero();
// Call the Status Process
status_screen();
write(0,160,160,4,"Press [Start] To Start ");
// Main loop
repeat
frame;
until (key(_esc))
// Destroy all running processes
let_me_alone();
// Unload resources
unload_map(0, g_Hero);
unload_map(0, g_Bg);
unload_map(0, g_Icon);
unload_map(0, g_Border);
end
// This is the process of our hero. It controls
// it movement with keyboard
process hero()
begin
graph = g_Hero;
x = 320/2;
y = 240/2;
loop
if (key(_right)) x+=1; end
if (key(_left)) x-=1; end
if (key(_up)) y-=1; end
if (key(_down)) y+=1; end
frame;
end
end
process Status_Screen()
begin
DRAWING_COLOR(12);
DRAW_BOX(10,10,100,40);
end
Here is what I have found that is useful:
- Fenix Manual - sadly doesn't list all functions or things like IF statements but it lists the most functions of any command reference I have found.
- Boolean Soup's Fenix Forum - They appear to be alive...
- Fenix Wiki - Lists stuff the Manual doesn't, like NET commands, loops (that's good) and using graphics (ooo!)
- Fenix On Fire - has a lot of English samples, many from Moogle and Quiest. Snippets are neat.
- FenixPenix - I mean Pixel! Just checking if y'all are readin'
They uh... they're into translating Fenix Documents. A lot of their command entries have no description - hardly useful.
Using as a base what Danko posted here, I have labored to produce...
CODE
program AMERYTH; // you can omit this if you want
// Global variables
global
int g_Hero;
int g_Bg;
int g_Icon;
int m_Athena;
int g_Border;
int exit;
end
Self explanatory. Ameryth is copyright. The "G_" variables are integers that will store the number of a graphic so they can be referred to by name.
CODE
// Main process (entry point)
begin
// Sets the graphic mode to 320x240, 16bpp, windowed
set_mode(320, 240, 16);
// FPS and maximum auto frameskip
SET_FPS(50,10);
// Load graphics. Load_XXX function return an int value
// which can be used later to refer to loaded resources
g_Hero = load_png("PNGs_320x240_max_WB\PNG_swordman3.png");
g_Bg = load_png("PNGs_Backgrounds\bg.png");
g_Icon = load_png("PNGs_Utility\base.fpg");
g_Border = load_png("PNGs_Utility\border_exact.png");
//Set the Icon up
set_icon(0,g_Icon);
Here the rendering mode is set, and that works. The graphics are loaded, and that works. The ICON thing doesn't work.
CODE
//Set up background Music
m_Athena = LOAD_SONG("Music\Athena.ogg");
PLAY_SONG(m_Athena,0);
Quiest mentioned using MP3's, then everyone at Boolean Soup started playing Alphabet Soup with his post, and I have no idea how he did it.
CODE
// Put a background image
put_screen(0, g_Bg);
Apparenty this is an important difference from other, hitherto unknown methods of pasting graphics on the screen.
CODE
// Call the hero process
hero();
// Call the Status Process
status_screen();
Fenix uses multithreading of some kind, I think; at least it uses separate processes. Anyway, HERO is one process, and STATUS_SCREEN the other. Case in names doesn't seem to matter.
CODE
write(0,160,160,4,"Press [Start] To Start ");
I just put the the text in to see what that looks like - it's a very big font, but specifying a font other than "0" (the first number) doesn't work... how do I get more fonts?
CODE
// Main loop
repeat
frame;
until (key(_esc))
// Destroy all running processes
let_me_alone();
// Unload resources
unload_map(0, g_Hero);
unload_map(0, g_Bg);
unload_map(0, g_Icon);
unload_map(0, g_Border);
end
That main loop runs the program - since each process is responsible for looping itself. Everything else is clean-up as the program closes.
CODE
// This is the process of our hero. It controls
// it movement with keyboard
process hero()
begin
graph = g_Hero;
x = 320/2;
y = 240/2;
loop
if (key(_right)) x+=1; end
if (key(_left)) x-=1; end
if (key(_up)) y-=1; end
if (key(_down)) y+=1; end
frame;
end
end
This works just fine, for what it is. Eventually I'll be doing something completely different.
CODE
process Status_Screen()
begin
DRAWING_COLOR(12);
DRAW_BOX(10,10,100,40);
end
I have tried loading a dithered PNG (every other pixel is transparent) but it always turns up GREEN. The (opaque) colored pixels, be they black or blue, turn green (which is the predominant color of the background image. But transparency works. Exporting this in different PNG formats, or even putting it inside an FPG using FPG EDIT (Fenix's image packer/editor) doesn't change this. HUH?
Basically, I need to set up a status screen for your typical RPG - where you see your character's status bars at the bottom and there's some enemy in front of you. I can ungay that later once you see the finished product, but for now it will sound like it just came out of a California parade.
Any and all help is appreciated. Here's the code again - simply comment out the music and change the PNGs to load whatever you want.
CODE
program AMERYTH; // you can omit this if you want
// Global variables
global
int g_Hero;
int g_Bg;
int g_Icon;
int m_Athena;
int g_Border;
int exit;
end
// Main process (entry point)
begin
// Sets the graphic mode to 320x240, 16bpp, windowed
set_mode(320, 240, 16);
// FPS and maximum auto frameskip
SET_FPS(50,10);
// Load graphics. Load_XXX function return an int value
// which can be used later to refer to loaded resources
g_Hero = load_png("PNGs_320x240_max_WB\PNG_swordman3.png");
g_Bg = load_png("PNGs_Backgrounds\bg.png");
g_Icon = load_png("PNGs_Utility\base.fpg");
g_Border = load_png("PNGs_Utility\border_exact.png");
//Set the Icon up
set_icon(0,g_Icon);
//Set up background Music
m_Athena = LOAD_SONG("Music\Athena.ogg");
PLAY_SONG(m_Athena,0);
// Put a background image
put_screen(0, g_Bg);
// Call the hero process
hero();
// Call the Status Process
status_screen();
write(0,160,160,4,"Press [Start] To Start ");
// Main loop
repeat
frame;
until (key(_esc))
// Destroy all running processes
let_me_alone();
// Unload resources
unload_map(0, g_Hero);
unload_map(0, g_Bg);
unload_map(0, g_Icon);
unload_map(0, g_Border);
end
// This is the process of our hero. It controls
// it movement with keyboard
process hero()
begin
graph = g_Hero;
x = 320/2;
y = 240/2;
loop
if (key(_right)) x+=1; end
if (key(_left)) x-=1; end
if (key(_up)) y-=1; end
if (key(_down)) y+=1; end
frame;
end
end
process Status_Screen()
begin
DRAWING_COLOR(12);
DRAW_BOX(10,10,100,40);
end