12/06/2023: Localization News - Tengai Makyou/Far East of Eden: Ziria!!!

OMG! ZIRIA! ZIRIA!!! IT ACTUALLY HAPPENED!! 34 YEARS LATER!! The epic/legendary Tengai Makyou/Far East of Eden: Ziria JRPG has finally been localized! Supper the Subtitler struck again! Simply unstoppable, NOTHING can prevent him from TOTAL PCECD localization domination!!!! WHACHA GONNA DO BROTHER?!?!
Main Menu

Tutorials or examples for beginners ?

Started by MrTimscampi, 05/01/2013, 10:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrTimscampi

Hi :)
I want to start PC Engine development but, honestly, documentation for HuC is quite scarce compared to what I'm used to :D (I'm a university student doing mainly Python and Java.)
I'm able to do VERY basic stuff like a Hello World, but that's as far as I can go with what I found online. Everything is either very basic (Show text) or forum topics discussing topics too advanced for where I am :-s
I'm trying to display a sprite at the moment. My goal is to work my way to a basic shoot em' up and go from there.
I have a 32x64 .PCX file in 16 colors (made in Photoshop) and I'm using this to load it:
#incspr(player, "sprites/player.pcx", 6)
#incpal(player_colors, "sprites/player.pcx")
Then I copied some things from example sources I've seen, but nothing shows up.

I don't know if this is correct, because I couldn't find any doc for it online... (I ended up on Obeybrew a long time ago when I tried to start programming for the PC Engine, but the site is now down and I can only access a cached version for parts 2, 6 and 7.)

Any link to a backup of the Obeybrew tutorial, any source that just loads a sprite and shows it (Ideally, with lots of comments :D) would be appreciated ;)

Thanks in advance :)

Edit: I've also tried to convert a 4bit BMP version of the file using bmp2pce in sprite mode and loading the GFX and PAL, but I get an error at compilation saying that my image is too small and needs to be at least 16x16.

OldMan

#incspr() and #incpal() only convert the graphics to a pce compatible format - they do not load anything. You have to do that in your code.

Check out the game samples at Aetherbutt. They should show you the basic steps, especially how to set up graphics for use. Most of what you need to do is in initialization functions that are called once before the main loop; step through what they do, and look the function calls up in the HuC documentation. That should give you an idea of how to do what you want.

Arkhan Asylum

http://www.aetherbyte.com/pce_proto.html

Here is an open sourced little thing with a few demo games that show alot of things.
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

MrTimscampi

Thanks for the links and quick answers :D
I'll look into all of that and try to make it work :p (I was already loading the sprites using load_sprites() and other functions to set it's position, priority, etc. but the screen was still all black xD )

OldMan

Quote...the screen was still all black.
Install and read up on mednafen. It has a debugger where you can see what is in VRAM.
Make sure your sprites are there, where you think they should be.

Also, check your pcx file  (in something like the gimp). Phototshop has been known to flip the palette :(
The Gimp can flip it back for you.

MrTimscampi

Managed to get my sprite on screen and move it with the pad :p
My code was working, but Photoshop screwed with the PCX and it wasn't working :p

I'm now making my sprite shoot other sprites. I think I'll allow 3 shoot, so I'll have 60 sprites left. (Player + 3 shoot = 4, I can have up to 64 on screen according to the documentation.)
I have one shot firing properly, but I can't find how to hide the sprite when it goes past the top of the screen :p
I know about the spr_hide function. My condition just isn't working :)
I'll keep working on it and I'll find where I'm messing up :p (As implied before, I'm familiar with C, but not a lot ^^ This is a good way to learn, though. HuC is fairly straightforward once you've read up a bit about it.)

Arkhan Asylum

Don't use Photoshop.

Find yourself a copy of NeoPaint if you want to deal with PCX files the right way.

Or, Grafx2.  http://code.google.com/p/grafx2/wiki/Downloads
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

OldRover

Quote from: MrTimscampi on 05/02/2013, 04:46 AMI have one shot firing properly, but I can't find how to hide the sprite when it goes past the top of the screen :p
I know about the spr_hide function. My condition just isn't working :)
What I do is move a sprite to 256,256 when it's "out of range". Make sure you use ints for sprite coordinates, not chars.
Turbo Badass Rank: Janne (6 of 12 clears)
Conquered so far: Sinistron, Violent Soldier, Tatsujin, Super Raiden, Shape Shifter, Rayxanber II

OldMan

We use a sprite_active flag. Init it to 0 (off), set it to 1 when you shoot.
When it goes off the screen, or hits something, change it back to 0.
Then in the sprite draw code, we check the flag: if it's 0, we hide the sprite and return (no use wasting cpu time moving an invisible sprite).

Check through your code and make sure you are not inadvertantly turning the sprite back on somewhere :)

Arkhan Asylum

#9
Yep.  This also allows you to dynamically allocate sprites that are on screen so you don't have finitely set things.

It's pretty awesome.  Atlantean does that.
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

dshadoff

Quote from: MrTimscampi on 05/01/2013, 10:06 PMI want to start PC Engine development but, honestly, documentation for HuC is quite scarce compared to what I'm used to :D (I'm a university student doing mainly Python and Java.)
I'm able to do VERY basic stuff like a Hello World, but that's as far as I can go with what I found online. Everything is either very basic (Show text) or forum topics discussing topics too advanced for where I am :-s
Have you looked at the Zeograd.com 'creations' pages ?
http://www.zeograd.com/creation_download.php
Many of those programs were written with comments for the purpose of being tutorials.