Author Topic: Developing for the Supergrafx or PC-FX  (Read 1450 times)

hcf

  • Jr. Member
  • **
  • Posts: 93
Developing for the Supergrafx or PC-FX
« on: July 12, 2009, 05:02:24 AM »
I was wondering if there is any homebrew scene about other NEC plattforms... Does anyone know if there is people who has made games for the Supergrafx or the PC-FX? I think that the PC-FX is too different, and I didn't heard about nobody who has programmed a homebrew game for it, but the Supergrafx is maybe more possible, as it's hardware is more similar to the PC Engine... but I have not found information about this either  :-s

Anyone has heard anything about it?  :)

Arjak

  • Hero Member
  • *****
  • Posts: 777
Re: Developing for the Supergrafx or PC-FX
« Reply #1 on: July 12, 2009, 05:09:21 AM »
I believe Chris Covell has done some work with the Supergrafx. You might want to try asking him.
He who dings the Gunhed must PAAAAY!!! -Ninja Spirit

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Developing for the Supergrafx or PC-FX
« Reply #2 on: July 12, 2009, 10:15:09 AM »
Super grafx is essentially a PCE programming wise.  It just has double the video stuff.... You already know how to code for the SuperGrafx pretty much!

as for PCFX....

we've messed with it.  It is rough.  A bit scary, and a pain in the ass to do.  But somewhat fun.   

You need the card and stuff for it, and as you have probably discovered, the homebrew for PCFX is not exactly existent really.. :)  plus the tools are all in Japanese.  That does not help at all.

« Last Edit: July 12, 2009, 10:17:18 AM by Arkhan »
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

Tom

  • Guest
Re: Developing for the Supergrafx or PC-FX
« Reply #3 on: July 12, 2009, 01:15:45 PM »
I was wondering if there is any homebrew scene about other NEC plattforms... Does anyone know if there is people who has made games for the Supergrafx or the PC-FX? I think that the PC-FX is too different, and I didn't heard about nobody who has programmed a homebrew game for it, but the Supergrafx is maybe more possible, as it's hardware is more similar to the PC Engine... but I have not found information about this either  :-s

Anyone has heard anything about it?  :)

 Quite a few of us have worked on the SGX platform. It's not difficult in the standard/default setup, but can get a little bit complicated/confusing when working with the window reg and priority modes. MagicKit nor HuC has any direct support for the SGX extra video controller (or the extra ram). I did write a SGX lib once, for HuC as a test, that allowed you to use the same video functions of HuC but on the second video controller. While the SGX functions are redundant/identical in the lib, calling these same functions twice (for both video controllers) is a poor method. HuC's video functions are slow as they are already, and doing map or sprite functions twice as much is really going to slow things down. Even Magickit's video functions are rather slow/unoptimized (which HuC just translates most of its own functions to).

 If anything, CC65 should be ported to PCE/SGX. And all hardware interface libs should be external, not internal (but still be included with the package).

hcf

  • Jr. Member
  • **
  • Posts: 93
Re: Developing for the Supergrafx or PC-FX
« Reply #4 on: July 12, 2009, 08:32:00 PM »
Thank you everybody for the information.  :D  Well, I think that I will forget about PC-FX future projects, hehehe

As far as the Supergrafx, thank you again for the info! I allways have felt curiosity for this plattform. Well, porting CC65 is too much for my programming skills...    :(

Tom, maybe in the future I will try to follow te same path that you walked (making something in HuC for the Supergrafx). Well, at the moment I want to finish my learning of the Turbografx, as there are concepts that I have not managed to get working yet (Arcade Card, for example) but I'm sure that in the future I will try to learn something about Supergrafx. If you say that there are problems with the speed, maybe it's possible to create a kind of game in which the speed is not important (again, I am thinking about adventure games like my Vampire Story, hehehe). Thank you very much for the info!!  :D

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Developing for the Supergrafx or PC-FX
« Reply #5 on: July 13, 2009, 07:29:10 AM »

 If anything, CC65 should be ported to PCE/SGX. And all hardware interface libs should be external, not internal (but still be included with the package).

or *cough* PCC *cough cough*

:-D
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Developing for the Supergrafx or PC-FX
« Reply #6 on: July 13, 2009, 12:18:55 PM »
When I made my SGX demo, I copied a few of the MagicKit graphics routines over to a SGX include file and changed them to write to the 2nd VDP.  Nothing special here at all, but you might find it useful: http://www.disgruntleddesigner.com/chrisc/data/SUPERGRAFX.ASM

One thing people might want to watch out for in the initialization routines is the write to register $F of VDP2; it turns on automatic VRAM to Sprite DMA, which you might not want or need if you don't use sprites in VDP2.

Also, here's a little bit of a faster SATB transfer code:

Code: [Select]
Update_Satb_SG:
stw   #$7F00,<_di ;Default SATB location
jsr set_writesg ;Load up into latch
tia   satb,$0012,$0200

lda #$13 ;Sprite transfer DMA
sta $0010
stw #$7F00,$0012 ;Copy the SATB __ONCE!!__
rts

The latter half of that code is needed only if you want sprites to be updated when you choose, not every VBlank.

And as far as indispensible documents go, these surely are:

http://cgfm2.emuviews.com/txt/sgxtech.txt
http://cgfm2.emuviews.com/txt/pcetech.txt

Finally, the one thing to watch out for are emulators which are not entirely accurate.  For example, YAME doesn't seem to emulate some (or any?) of the features of the VPC in the SGX, and Magic Engine (1.0) has the extra RAM of the SGX on by default, but none of the other SGX features unless it detects one of the few commercial SGX games being played.  At any rate, this half-assed implementation confuses the simple SGX hardware detection routines in my code.  But, ah, well...

Tom

  • Guest
Re: Developing for the Supergrafx or PC-FX
« Reply #7 on: July 13, 2009, 01:32:23 PM »
Sorry to go off topic, but speaking of SATB updating and SATB DMA. SATB auto update happens right after the active display ends on the VDC side. If you write to (or read) VRAM, the CPU will be stalled the whole 3 scanlines ( length for low res mode IIRC) of the SATB DMA. While that's only like 1% CPU time in a single frame, it's 9% vblank time. Might want to do some other things and not a SATB local to vram call right at vsync(). Also remember, using vblank to do SATB local transfer puts sprites out of phase by 1 frame. (I use an H-int line to generate an earlier pseudo vblank() call and do my satb local update then, just for simplicity reasons).

 Also, after working on the Genesis and its really nice sprite dynamic link-list system - one could replicate that on PCE. Using self modifying code, setup 64 areas of ST1/2 opcodes. The operands of the instructions should have equates, which is no big deal. Of the 64 entries/sections of ST1/ST2 codes, there should be an RTS at the end(maybe pad a NOP too for quick address calculation for other code access, etc). Then make a table with all the starting points of each local SATB entry. Your overhead would be a JSR to a jmp [table,x] routine. X corresponds to the SATB be entry. You can easily do a 64byte array to simulate the link list. Instead of doing a TIA of the whole local block, you run through the link-list array and call that corresponding code block update. ST1/ST2 is faster than TIA to vram, so the added overhead of JSR and jump table is only slight. Plus, you have the added benefit of not stalling the TIMER interrupt. Which is always a good thing.

 There are other ways to simulates a link-list system, but they're slower; multiple TIA's (the call overhead adds up, still stalls TIMER INT), manual copy with a loop (pretty slow in ASM, *extremely* slow if done in C with HuC), or just manually re-arranging all the local satb entries by manual loop/copy code (slowest method of them all, and add that on top of HuC for some real piss poor performance).

 If you're not familiar with a sprite link-list system then here's the run down; the video processor grabs the first sprite in the table and fetches all the attributes but instead of going to the next physical entry, it jumps to the next entry designated by the link-list value. It does this until it reaches the max number of sprite entries OR it links to a termination entry (IIRC, is itself). You can very easily re-order priorities of sprites with this technique. Simple games might need much re-ordering, but a system that has a Z binary depth style position system would ( SF2, Final Fight, 3/4 RPGs, even top down RPGs, etc). A link-list is extra useful for complex sprite clipping systems (many PCE games do this due to a lack of a second layer for complex clipping).
« Last Edit: July 13, 2009, 01:35:50 PM by Tom »

hcf

  • Jr. Member
  • **
  • Posts: 93
Re: Developing for the Supergrafx or PC-FX
« Reply #8 on: July 13, 2009, 07:53:20 PM »
Chris, thank you for all that information. It's very nice to see you here! We hope that you can come back to the PC Engine scene as soon as you can!  :D

Tom, that thing about the sprite link-list system is pretty interesting! Have you tested any of your methods? I missed that "Z-coordinate" when I was thinking about another kind of game, in order that we can decide which sprite is in front, without re-ording all the sprites table. I'm afraid that in my case (working with HuC) making that link-list system can be as slow as re-ordering the sprite table, but... do you think that making that in assembler can worth the processing time?