Author Topic: PC-FX homebrew development.  (Read 17571 times)

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #135 on: March 12, 2016, 03:38:28 AM »
I made an RGB to YUV conversion utility that takes a JASC-PAL 16 or 256 color palette and spits out a header file with the palette encased in an array. Hopefully I got everything right... I have not actually used it in a source file yet because I don't yet have anything to convert actual graphics with, but this is a start.

http://www.frozenutopia.com/pal2yuv.7z

Source code is included; built using fbc 1.05, not gcc, so it's probably out of some people's comfort zone, but it's right at home for me. :lol:

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: PC-FX homebrew development.
« Reply #136 on: March 12, 2016, 04:54:47 AM »
Since I'm not familiar with the machine, or the compiler generated code, I'll leave it  to the experts.

With these old CPUs, it's definitely a good exercise to take a look at what the compiler generates to see how good a job it's doing.

One of the big things to note about the V810 is that all loads from memory-to-registers are automatically sign-extended to 32-bit, and that all internal arithmetic is done as signed 32-bit.

So any "unsigned" C variables are likely to need another instruction to zero-extend them (usually an "and"), and that you don't get much (if any) benefit from using 8-bit or 16-bit ("char" or "short") variables.


Quote
As for the input checks...we do it all the time. It's easy enough to use a #ifdef/#endif to turn them
on/off.

Having extra checks that are only compiled in "debug" mode is definitely good practice.

But "clamping" or "wrapping" is IMHO almost never a good idea in game development.

An "assert" is a good way to cause an instant blow-up, and so to cause a programmer to see and fix a problem.

"Warning" messages just tend to be ignored until they become a more-serious problem.


Okay so now this subforum needs to be changed to Turbo/PCE/PC-FX Game/Tool Development... :lol:

 :wink:


Source code is included; built using fbc 1.05, not gcc, so it's probably out of some people's comfort zone, but it's right at home for me. :lol:

FreeBASIC? Wow! Well, each of us has our own comfort-zone.

I'm investigating "Go" to see if it's good replacement for "C" for tool/systems programming.

It's the first "modern" langauge that I've ever seen that actually seems well-designed and aimed at the solving the kind of problems that I've seen in my years of software development.

Gredler

  • Guest
Re: PC-FX homebrew development.
« Reply #137 on: March 12, 2016, 08:54:36 AM »
An "assert" is a good way to cause an instant blow-up, and so to cause a programmer to see and fix a problem.

"Warning" messages just tend to be ignored until they become a more-serious problem.


From a content creation viewpoint I would certainly agree. The warnings become neglected and not addressed unless noticed during gameplay, and are almost always ignored and often referred to as red spew.

Asserrts are unavoidably required to be corrected, submitting files that are causing asserts hardly happens because during the testing phase before submission it's blatent that your changes broke the build.

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: PC-FX homebrew development.
« Reply #138 on: March 12, 2016, 09:48:59 AM »
From a content creation viewpoint I would certainly agree. The warnings become neglected and not addressed unless noticed during gameplay, and are almost always ignored and often referred to as red spew.

Hahaha!  :wink:

Color-coding the insane volume of messages that most games spit out is one of the first attempts to try to stop the "important" stuff from getting lost in all the "noise".

It never works.

There's never enough free time to fix the "small" stuff ... so it just gets sidelined with a "we'll fix it later".

That's why I like "asserts" for things like bad parameters to functions ... it causes the problem to be dealt with at a time when somebody still probably remembers why that change was made that broke things.


Quote
Asserts are unavoidably required to be corrected, submitting files that are causing asserts hardly happens because during the testing phase before submission it's blatent that your changes broke the build.

Yeah, someone repeatedly "breaking the build" is a self-correcting problem ... either the peer-pressure will cause the offender to learn better habits, or if they're too stupid to do so, they'll get fired, and the average I.Q. of the team will raise by a couple of points.

Either circumstance is a "win" for the team.


*************

Anyway ... back to the PC-FX.

On the "plus" side ... the toolchain now goes through the magical "2nd-GCC-build" stage that's needed to get newlib working properly, and I've got newlib actually linked into a test program.

That means that we've now got "stdlib", and "sprintf", and "malloc", and all those other goodies.

On the "negative" side ... calling "sprintf" crashes.

2 steps forward, 1 step back ... as usual.  ](*,)

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #139 on: March 12, 2016, 11:10:39 AM »
All the apps in the PC-FXGA download are incompatible with Windows 7... guess I better install a VM. :)

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: PC-FX homebrew development.
« Reply #140 on: March 12, 2016, 03:40:07 PM »
Ah, yeah, Windows 7 broke my TurboRip app also because Microsoft tightened security and no longer allowed you to build a SCSI command packet for reads and pass it directly to the CD/DVD drive, you must instead use their SPTI methods for reading data/audio sectors, otherwise the packet is rejected...

All other command packets to read the CD's TOC, set the drive speed, etc. are allowed, just command packets for reads are policed. You also cannot read a MODE1 sector in raw 2352 form, only in 2048 cooked... MODE2 sectors have multiple forms, and they couldn't police raw reads there as then you couldn't detect Form 1 or 2, so they left that alone...

I suspect they pissed off a lot of developers/customers by breaking many apps having done this though which might explain why such SCSI policing was removed for Windows 8/8.1/10 and CD/DVD apps started working again, TurboRip included. But anyway, I researched the changes needed and actually got it working on Windows 7 after johnnykonami/SamIAm reported the problem to me.

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #141 on: March 12, 2016, 04:43:46 PM »


After a hard-fought battle, I finally got Windows 95 installed into a VM and the PC-FXGA toolset installed... this looks like the only thing really worth using in the whole bloody package though... aside from the docs that are all in Japanese... :lol:

SamIAm

  • Hero Member
  • *****
  • Posts: 1835
Re: PC-FX homebrew development.
« Reply #142 on: March 12, 2016, 04:58:34 PM »
Ah, good old MPCONV2. How many times did it get used to encode yet another test video for Zeroigar subtitles? It must have been hundreds.

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: PC-FX homebrew development.
« Reply #143 on: March 12, 2016, 07:37:15 PM »
Hm, so https://www.virtualbox.org/ ?

I use Microsoft's Virtual PC 2007, but I don't recall it allowing Windows 95, lowest selection was 98 I think. I resurrected a real Windows 95 PC I bought in 1996 however, my first computer which I still have. It would be useful to get a Win95 install set up in my main workstation though for rare testing when needed assuming it works reasonably well in an emulated setting. Will check out VM Box some time.

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: PC-FX homebrew development.
« Reply #144 on: March 13, 2016, 05:56:28 AM »
I use Microsoft's Virtual PC 2007, but I don't recall it allowing Windows 95, lowest selection was 98 I think. I resurrected a real Windows 95 PC I bought in 1996 however, my first computer which I still have. It would be useful to get a Win95 install set up in my main workstation though for rare testing when needed assuming it works reasonably well in an emulated setting. Will check out VM Box some time.

IMHO Virtual PC 2007 is better than VirtualBox for a DOS/Win3/Win95 virtual machine, mostly because it emulates an older set of hardware, and it comes with "shared folder" additions for those old OS versions that IIRC VirtualBox doesn't.

If you want to run Win95 or earlier on Virtual PC 2007, just set the OS to "Other" and use the "additions" from Virtual PC 2004 (they work fine).


After a hard-fought battle, I finally got Windows 95 installed into a VM and the PC-FXGA toolset installed... this looks like the only thing really worth using in the whole bloody package though... aside from the docs that are all in Japanese... :lol:

Hahaha ... you wimped-out and didn't install the Japanese version of Windows!  :wink:

I ended-up buying a copy of Win95 OSR2.5 from Japan just so that I could run all the PC-FXGA utilities on my old PC that has the PC-FXGA card installed.

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #145 on: March 13, 2016, 06:40:01 AM »
Hahaha ... you wimped-out and didn't install the Japanese version of Windows!  :wink:

Nah dude, just didn't get that far... wanted to know I could even get it to work before going through such trouble.

EDIT: The program runs in Windows XP but I don't know yet how well it actually functions:

« Last Edit: March 13, 2016, 06:54:14 AM by The Old Rover »

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: PC-FX homebrew development.
« Reply #146 on: March 13, 2016, 07:10:17 AM »
EDIT: The program runs in Windows XP but I don't know yet how well it actually functions:

IIRC, WinXP is the last version that included a compatibility-layer for 16-bit Windows programs.

Good to know that MpConv2 runs on it.

If it runs at all, then I'd be a bit surprised if it didn't run correctly ... it's just doing graphics/sound processing, and I don't remember it having a direct connection to the PC-FXGA hardware.

EDIT:

I just checked again ... it's been a while since I looked.

MpConv2 has both Japanese and English resources (as so looks fine on an English version of Windows), but its .hlp file is all in Japanese, and looks like garbage on English Windows).

Hudson's AGE graphics editor only contains Japanese resources, and a Japanese .hlp file.

It's possible to extract/translate/reinsert both the resources and the .hlp file contents ... but it's one heck of a lot of work.

I can just-about see it being worthwhile for MpConv2, because the PC-FX video is unique, and there is no other tool available to do the conversion.

AGE, OTOH, is a pretty crappy graphics editor whose only real use is in converting BMP images into the PC-FX's bitmap and tile formats ... and these tasks are usually better performed with modern tools and modern formats (like PNG).

I did use it to convert Zeroigar's English title-screen, because it saved a bunch of time in writing an alternative ... but it's not really a good long-term solution.


« Last Edit: March 13, 2016, 08:07:31 AM by elmer »

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #147 on: March 13, 2016, 11:35:15 AM »
I have AGE (Awful Graphics Editor) almost figured out. Yeah, in the long run, it's a rather poor program, and forget about using it as a graphics editor... I think MS Paint is more useful... but as a conversion tool, it does the trick for now. I'm using Borland Resource Workshop 4.5 to edit it.


elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: PC-FX homebrew development.
« Reply #148 on: March 13, 2016, 12:08:56 PM »
Just in case  anyone out there that understands Japanese is looking at this and thinking "This is all very cool, I wish that I could help!" ... then here's your opportunity!  :wink:

SamIAm is rather snowed-under with everything that he's doing on the Xanadu  games, so I'd really rather not pester him for help on this.

Here is the documentation for mpconv2 in .rtf and .doc format.

https://www.dropbox.com/s/9pia84lwn3einla/mpconv2e.zip?dl=0


It would be really great if someone could translate the Japanese text into English (preferably without destroying the actual formatting so that it can be recompiled into a .hlp file).

There are a bunch of embedded pictures in there, but I'm not expecting anyone to get out a paint program and try to edit those (although it would be wonderful if someone did).

Is anyone willing to help?

nodtveidt

  • Guest
Re: PC-FX homebrew development.
« Reply #149 on: March 13, 2016, 12:46:18 PM »
I can do replacement graphics for AGE's help file once it's translated, if that helps.