ASM on PC Engine

Started by AmigaHeretic, 01/07/2009, 11:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AmigaHeretic

Hi there.  New to the site and just got approved to post!  So I've been looking at doing some coding on the PCE and have been testing out HUC and checking out some source code around the internet.

Now I've made a couple of .c HUC programs and it look like it converts it to .s and then PCEAS compiles/links it into a .pce rom.  Question is that there seem to be a ton of .asm files out there, but PCEAS that comes in HUC archice (Magic Kit I assume) doesn't know what to do with these files. (I'm using Winsystem :-( ) Is there another ASM compiler people are using?  Or ??  I can't get any .asm files I found out there to compile, but have no problem compiling the .s files HUC makes.

Is there any good reference material to get to know the PCE HD?  Have no real ASM experience so I may be trouble anyway as I noticed trying to debug HUC code is 'fun' so far. 

My TG16 and Duo are my favorite video game system of all time.  It's been exciting getting some stuff running on it. 

Thanks!
AmigaHeretic
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
---------------------------------------------------------------------------
Back in my day, we didn't have water. We only had Oxygen & Hydrogen, & we'd just shove 'em together

Arkhan Asylum

HuC uses a rebuilt pceas.exe (V 3.21) and different .asm libraries.   The assembly files it generates and passes to the pceas.exe it comes with, wont work with Magic Kit's v2.51 assembler....


so... if you write stuff in HuC, it's not entirely backwards compatible with MagicKit

I suggest you dive headfirst into MagicKit v2.51

grab a decent 6502 assembly book from somewhere, and check out the included pce demos.


also make sure you look at the PCE documents so you know how the hardware works.
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!

Arkhan Asylum

(Wheres the post edit button! I feel retarded double posting! >_<  :-" )

I fired you an email with the pce demos in assembly for Magic Kit

If you grab plain ol' Magic Kit 2.51, it has the PC Engine hardware documentation also (in the /docs folder).  It explains how sprites work, how the PSG works, and all that good stuff.  It is pretty handy.  I printed it all out, put in page protectors, and stuck it in an aluminum binder.   It is my PC Engine tome.  :-D

OH and the catch about doing Magic kit vs. Hu-C

if you set PCE_INCLUDE on windows to the hu-c folder, and your PATH includes /huc/bin, you will have to change these to point to mkit251_dos/include and mkit251_dos/bin instead in order to properly assemble any .asm files that were written with Magic Kit as the target.  Otherwise it might try using the Hu-C libraries and or the Hu-c version of pceas.exe, and that wont work!

:)
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!

NecroPhile

Welcome aboard, AmigaHeretic.  :)

Quote from: Psycho Arkhan on 01/08/2009, 06:41 AM(Wheres the post edit button! I feel retarded double posting! >_<  :-" )
The 'modify' button is in the top right of your post, nestled between the 'quote' and 'remove' buttons.  :wink:
Ultimate Forum Bully/Thief/Saboteur/Clone Warrior! BURN IN HELL NECROPHUCK!!!

Arkhan Asylum

Quote from: NecroPhile on 01/09/2009, 12:00 AMWelcome aboard, AmigaHeretic.  :)

Quote from: Psycho Arkhan on 01/08/2009, 06:41 AM(Wheres the post edit button! I feel retarded double posting! >_<  :-" )
The 'modify' button is in the top right of your post, nestled between the 'quote' and 'remove' buttons.  :wink:
...
...
... oh! ... i am used to it being on the bottom right and saying EDIT from another forum.

woops! ;-D
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!

AmigaHeretic

Great! Thanks for all the information.  I actually downloaded MK 2.51, but assumed it was older than the 3.21 that came with HuC, so that clears it up.  Thanks for the heads up on the path too that probably would have caused me more headaches! 

Guess I'll be spending a lot of time at http://www.6502.org/ ? :-)

I'll probably print out the docs and start playing around.  Maybe this'll help me get better at my 68000asm too.

AmigaHeretic
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
---------------------------------------------------------------------------
Back in my day, we didn't have water. We only had Oxygen & Hydrogen, & we'd just shove 'em together

Arkhan Asylum

hehe.
yeah, a good 6502 book or two on ebay is always a plus also.

As long as its not called 6502 for dummies, or LEARN 6502 IN 30 DAYS!  :-D
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!

TurboXray

If you're looking for a book, then something about the 65C02 would be better or R65C02S if you can find it. Also, not sure why he (<_< ) didn't mention the PCE coding IRC channel on efnet (utopiasoft). You can get lots of PCE assembly help there. Hardware too.

 If you never coded for a 65x, but have for 68k or x86 or z80 - then be prepared to be baffled ;)

 Totally different style of coding. If you're looking for DOCs, I have many  :)

OldRover

I didn't find the transition from the 65xx to the x86 to be too terrible, but the Z80 and 68K are truly weird beasts in comparison.
Turbo Badass Rank: Janne (6 of 12 clears)
Conquered so far: Sinistron, Violent Soldier, Tatsujin, Super Raiden, Shape Shifter, Rayxanber II

AmigaHeretic

The book I started with is Eyes, David & Lichty's "Programming the 65816 Including the 6502, 65C02 and the 65802".

But it looks like there are tons of 6502 books so I'll try to get some others later.

Thanks for IRC info I'll will have to check it out especially as I get stuck. :)  And I'll probably be hitting you up for docs at some point, so thanks again for the offer.


Just been playing around with some basics.  Coming from the Amiga it's just a little different.  The sprites are kinda cool with each one being to have it's own 16 color palette.  So even though there are only 512 colors it actually offers a some cool possibilities.    If anyone has a recommendation or let me know what you guys pixel your images in that would be great.  The few test sprites I did in Photoshop, but I've never really had to use something other than 8bit, 16, 24bit color in it.  Making graphics on the Amiga which is "12bit" color I just used one the paint programs there.  Never thought about how I'd go about doing Amiga 12bit graphics on PC.   So not a huge deal, but it would nice to see if there was something where I could just straight chose 9bit palette (which I can probably do in Photoshop more easily than I'm doing, but...)  so that I can match up the #000-#888 numbers a little more easily. 

Thanks for all the help guys!
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
---------------------------------------------------------------------------
Back in my day, we didn't have water. We only had Oxygen & Hydrogen, & we'd just shove 'em together

TurboXray

#10
Quote from: AmigaHeretic on 01/11/2009, 05:34 PMSo not a huge deal, but it would nice to see if there was something where I could just straight chose 9bit palette (which I can probably do in Photoshop more easily than I'm doing, but...)  so that I can match up the #000-#888 numbers a little more easily. 
There are converted color charts show all the colors, and then some mapped logically or HSL like this - pcedev.net/gfx_tools/ . Those are just some rough ones.
 
 Photoshop have a nice feature - posterize. Set the levels 8 to force to 3bit R/G/B. Or you can manually edit a palettized picture using R/G/B *36 entries. N*32 tends to be to dark, but 36 increments shifts back down to 3bit just fine and looks better in PS too. Looks closer.

 I actually use photoshop to manage my tilesets/palettes and even build maps. Set the grid to 8x8 and 'snap' on, and copy paste my tiles. I use mask layers(50%) to keep track of which tiles belong to which palette set:

pcedev.net/sf2_hack/tech/sf2_guile.png, sf2_guile_palmap.png sf2_guile_tilemap.png

 I currently embed the subpalette code into the colors themselves. The slight differences between the increment signifies the associating subpalette.

        //R,G,B
array = { 0,0,0
          0,0,1
          0,1,0
          1,0,0
          1,0,1
          1,1,0
          //etc
          }
If(n>0) { converted_value=n*(36-array[(sub_pal*3)+i]); }
 else { converted_value=array[(sub_pal*3)+i]; }

 i = red(0), green(1), or blue(2).
 n=0 to 7.

 I export all the tileset ACT palettes and run it through my util and create a master 256 color palette with each subpalette being one of 16 groups of color and each group having its own unique identifying colors per segment. I force the final layer to 8bit and this master palette. Photoshop resnaps the colors of the whole picture into the proper ranges. On the receiving side, for the entire picture (or FMP 1.0 file) I just treat of the upper 4bits of the 8bit pixel as the subpalette number and the lower 4bits as direct pixels.

 That's if you have larger more complex palette arranged tilemaps. For smaller/simpler projects, you can just keep track of the tiles by hand and use the directives of Mkit (PCEAS) for facilitating that. My current project had 1350 unique tiles and there's no way I was going to keep track of that by hand, let alone if I need to make modifications and shuffle tiles.

AmigaHeretic

That's sounds like a great way of keeping a lot of tiles organized. I'll have to try posterize again and just see how I can get the colors to match up.  Just need to play with it a bunch I guess.

I found a program I already had can do sort of what I was originally thinking and that is just basically going into a sort of direct 9 bit mode.  So I can go in and choose say, 16 to 256 colors out of a maximum palette of 512.  Then the R, G, B sliders each only go from 0-7.  It shows 32 colors colors on each line, so if I'm getting this right those would be for example the first two palettes, etc.  Nice thing is I can quickly see by clicking on a color basically $1,7,4 or whatever.  For the moment with just a few sprites it works OK.

Made a YouTube video of it because the program is an Amiga program, which is fine, but still on the look out for something on Win that does a similar function.

youtu.be/wYIbhN2LeOA
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
---------------------------------------------------------------------------
Back in my day, we didn't have water. We only had Oxygen & Hydrogen, & we'd just shove 'em together

Arkhan Asylum

hopefully you dig grafx2 and its amiga paint program style setup!

its a shame they never implemented a few of the final features.... at least you probably wont die without them...all the important stuff (all the brushes and effects, colors/palettes, lines and stuff) are there..  plus its lightweight, handles PCX format awesomely, and you can set the screen res to PCE screen res and see your sprite as it'd appear in a game. 

the brush grab options are my favorite part.  Makes animating easy.

 
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!