gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > XY-MINI Final Specification

#155299 - zzo38computer - Sun Apr 27, 2008 11:03 pm

The final specification is now made. It now includes a license allowing you to use/modify/redistribute this document under certain conditions. I would like to see if someone could write a interpreter for it.

http://zzo38computer.cjb.net/xym/xym_spec_0_9.doc
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.


Last edited by zzo38computer on Fri May 02, 2008 4:38 am; edited 1 time in total

#155305 - tepples - Mon Apr 28, 2008 12:36 am

These comments on the specification are in no particular order, but any implementer would be interested in their answers:

"What color to use for foreground and background is implementation dependant."
What motivated this? Would there be a special problem with just using palette entries 0 and 1?

"Colors are specified as RGBY values (see below) - with 2 bits for each primary color."
In what color space are the RGB values assumed to exist? I'd guess that values 0, 1, 2, and 3 correspond to sRGB values 0.000, 0.333, 0.667, and 1.000. Is this correct?

"The frequency is specified in quarter-tones."
Good-bye pitch vibrato.

"Copy the ASCIIZ string following the command, to the memory location specified by the 'Extra Pointer'."
"This Interpreter-Directive instructs the interpreter to HALT the program and print the ASCIIZ message following the command (using whatever method is appropriate). The string is interpreted as pure ASCII - no font translation is applied."
Good luck trying to sell this concept to native speakers of any language other than English.

"A SAVE device must support at least 2k of addressable space. It can optionally support more - but that will have to be know by the specific interpreter and software."
Is there a way to poll for how much space is available, or to provide for more than 64 KiB? I can already think of applications that would need more than 64 KiB.

"Channel 0 ... Sine Wave"
"Channel 5 ... Triangle Wave"
Are these waveforms to be emulated as ideal waveforms, or for example, does the triangle wave work like the one on the NES (32-step pattern 0123456789ABCDEFFEDCBA9876543210)?

"FFF3: Display X size (in characters ? each 8 pixels wide) (see note 3)
FFF4: Display Y size (in characters ? each 8 pixels tall) (see note 3)
Note 3: Each of these values is initialized to the maximum supported by the attached display hardware."
The product of FFF3 and FFF4 cannot exceed 2,048; otherwise, it would overflow display RAM. Nor do I see anything about scrolling of tiled layers. And is there anything that specifies the pixel aspect ratio, or are pixels assumed to be square like they are on Game Boy, GBA, DS, and most PC video cards since VGA?

"0040-004F: Creator Name (ASCIIZ) ? like a copyright notice"
I can think of a lot of authors whose names are longer than 15 characters or contain characters not in ASCII. I think that's why NSF uses a 32-byte field for this.

"bit 0: A button
bit 1: B button"
Is there a specification for which button appears where on the controller? NES, TG16, SNES, Jaguar, N64, GameCube, Wii Classic Controller, Game Boy, Lynx, GBA, GP32, and DS have A or 1 on the right and B or 2 on the left (think: A for accelerate, B for brake). Genesis, 3DO, Saturn, Dreamcast, Xbox, Xbox 360, Wii Remote, Game Gear, and GP2X have them the other way around.

"FFF0-FFF1: 16-bit value (high-order byte in F0) Increments with each video frame interval"
How many instructions can execute between one increment of this value and the next? Or is the clock rate assumed to be infinite, where only instruction 0x1D (FRAME) can advance the counter?

"#CLOCK [...] 0x04: Deci-Seconds (one-tenth) 0 to 9"
Is there a number of increments of 0xFFF0 per deci-second, or are programs supposed to measure this when they start?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#155612 - zzo38computer - Thu May 01, 2008 7:54 pm

Thanks. These are good questions. I will think about it more tomorrow.

tepples wrote:
"What color to use for foreground and background is implementation dependant."
What motivated this? Would there be a special problem with just using palette entries 0 and 1?

Monochrome mode doesn't have palette entries.

Quote:
"Colors are specified as RGBY values (see below) - with 2 bits for each primary color."
In what color space are the RGB values assumed to exist? I'd guess that values 0, 1, 2, and 3 correspond to sRGB values 0.000, 0.333, 0.667, and 1.000. Is this correct?

Yes that is correct.

Quote:
"The frequency is specified in quarter-tones."
Good-bye pitch vibrato.

What is pitch vibrato supposed to do? Tell me what you use it for.

Quote:
"Copy the ASCIIZ string following the command, to the memory location specified by the 'Extra Pointer'."
"This Interpreter-Directive instructs the interpreter to HALT the program and print the ASCIIZ message following the command (using whatever method is appropriate). The string is interpreted as pure ASCII - no font translation is applied."
Good luck trying to sell this concept to native speakers of any language other than English.

These are basically 2 different things. The copy ASCIIZ string just means that it ends at null (the person who actually typed it, because he is a professional and I am not, still called it ASCIIZ even if it is not necessarily ASCII). The FATAL command displays ASCII text (where decimal 65 writes "A", for example). It wouldn't work very well with accented letters, though.

Quote:
"A SAVE device must support at least 2k of addressable space. It can optionally support more - but that will have to be know by the specific interpreter and software."
Is there a way to poll for how much space is available, or to provide for more than 64 KiB? I can already think of applications that would need more than 64 KiB.

I guess to probe the amount, try a max you need, if it doesn't work, display a error message.

Quote:
"Channel 0 ... Sine Wave"
"Channel 5 ... Triangle Wave"
Are these waveforms to be emulated as ideal waveforms, or for example, does the triangle wave work like the one on the NES (32-step pattern 0123456789ABCDEFFEDCBA9876543210)?

They should be ideal waveforms, but a lower quality interpreter might use a lower quality one, until someone fixes the source code to make it a higher quality, like a ideal one.

Quote:
"FFF3: Display X size (in characters ? each 8 pixels wide) (see note 3)
FFF4: Display Y size (in characters ? each 8 pixels tall) (see note 3)
Note 3: Each of these values is initialized to the maximum supported by the attached display hardware."
The product of FFF3 and FFF4 cannot exceed 2,048; otherwise, it would overflow display RAM. Nor do I see anything about scrolling of tiled layers. And is there anything that specifies the pixel aspect ratio, or are pixels assumed to be square like they are on Game Boy, GBA, DS, and most PC video cards since VGA?

If the size is larger than the possible maximum the program needs, it will reduce the values. Sorry I don't have anything about scrolling, if you want to make a suggestion how I should add scrolling, make a suggestion about it, please. The pixels are assumed to be square, if they are slightly off because the actual display is slightly off, don't worry about it too much.

Quote:
"0040-004F: Creator Name (ASCIIZ) ? like a copyright notice"
I can think of a lot of authors whose names are longer than 15 characters or contain characters not in ASCII. I think that's why NSF uses a 32-byte field for this.

OK I might change this. Even if not, you could use a abreviation and use the proper one later in the program (of course this won't work if it is audio only, though). It can come with text file explaining instructions, also

Quote:
"bit 0: A button
bit 1: B button"
Is there a specification for which button appears where on the controller? NES, TG16, SNES, Jaguar, N64, GameCube, Wii Classic Controller, Game Boy, Lynx, GBA, GP32, and DS have A or 1 on the right and B or 2 on the left (think: A for accelerate, B for brake). Genesis, 3DO, Saturn, Dreamcast, Xbox, Xbox 360, Wii Remote, Game Gear, and GP2X have them the other way around.

I guess you might have a swap A-B option for setting how you want it, like the Goomba color and NES emulator on GBA/NDS does.

Quote:
"FFF0-FFF1: 16-bit value (high-order byte in F0) Increments with each video frame interval"
How many instructions can execute between one increment of this value and the next? Or is the clock rate assumed to be infinite, where only instruction 0x1D (FRAME) can advance the counter?

The clock rate is assumed to be as fast as possible. The FRAME instruction waits for the next frame. If you want, you could write the program to check if the number changed before FRAME command, if so, display error message.

Quote:
"#CLOCK [...] 0x04: Deci-Seconds (one-tenth) 0 to 9"
Is there a number of increments of 0xFFF0 per deci-second, or are programs supposed to measure this when they start?

You are right. Probably 30 frames per second would be good? If you don't agree, tell me what it should be. Of course the number of frames per second might change depending on configuration of the interpreter, but there should still be a default number of frames per second. I think 30 fps is good, if you don't believe me, tell me something else.
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#155641 - tepples - Thu May 01, 2008 11:57 pm

Quote:
Monochrome mode doesn't have palette entries.

So is it black-and-white, like Apple II and IBM CGA/EGA monochrome mode, or is it white-and-black, like 68000 Macintosh monochrome mode?

Quote:
What is pitch vibrato supposed to do? Tell me what you use it for.

Listen to the tree cut scene music from Dr. Mario, composed by Hip Tanaka. Notice how the long notes modulate up and down slightly in pitch to sound fuller and sweeter, and they do this in units far smaller than 50 cents. [EDIT: fixed] Here's a Vorbis file of the song, and here's the spectrogram of 1:20.6 through 1:25.0 (notice the jagged line).

Then go watch any movie that has been mastered to THX specifications. You'll notice that the pitches of the 30 voices of "Deep Note" step in increments smaller than 50 cents.

Quote:
I guess to probe the amount [of save data space], try a max you need, if it doesn't work, display a error message.

But the interface you listed still doesn't allow seeking past 64 KiB. And how would one define "doesn't work"? What is read back when the program tries to seek past the end?

When I evaluate a video game platform, among the first things I evaluate are whether it is "Tetris complete", whether it is "Mario complete", and whether it is "Animal Crossing complete". The NES can handle Mario and Tetris, but it has neither enough RAM nor enough save space for a social sim. There was a stripped-down SimCity for the NES, but like Earthbound: Prototype, it was canceled before release due to the cost of replication for a cart with so much battery RAM and the advanced mapper needed for palette switching at the 8x8 pixel level. Even the SNES, which had SimCity Classic and the first Harvest Moon game, couldn't handle anything like AC because carts still didn't have enough save space.

Quote:
Sorry I don't have anything about scrolling, if you want to make a suggestion how I should add scrolling, make a suggestion about it, please.

It's a Mario completeness issue. I'd recommend 16-bit read/write X and Y scroll position registers, along with a flag for whether the scroll should wrap or clip. Some host platforms might not support scrolling; if not, they will always read back 0 in the scroll registers.

Quote:
If you want, you could write the program to check if the number changed before FRAME command, if so, display error message.

That or just use it to make sprites and the music position move farther in the next frame.

Two more things about the ASCIIZ fields: First, you could make them UTF-8Z. Second, you could define the behavior when the last byte is not a NUL: the string is exactly 16 bytes (or whatever) long, and an interpreter might need to use a 17-byte buffer to hold it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Fri May 02, 2008 12:27 pm; edited 2 times in total

#155653 - zzo38computer - Fri May 02, 2008 4:38 am

I added scrolling, as follows:
FFC2 Scroll flag (bit0 enables scrolling, bit1 wraps if set (clips if clear), others reserved)
FFC3-FFC4 Scroll X position (used only if scrolling is enabled)
FFC5-FFC6 Scroll Y position (used only if scrolling is enabled)
FFC7 Map X size (used only if scrolling is enabled)
FFC8 Map Y size (used only if scrolling is enabled)

And, don't you mean 50 cents instead of 500 cents?

I fixed a few other typing mistakes as well. It is now xym_spec_0_9.doc (it isn't really final, but I thought it was, at first, sometimes I make mistakes, as anyone does)
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#156924 - zzo38computer - Fri May 16, 2008 5:59 am

I fixed the header fields, it is now 32 bytes instead of 16 bytes for the ASCIIZ fields in the header. Also more typing mistakes has been fixed. http://zzo38computer.cjb.net/xym/xym_spec_1_0.doc I also made a assembler now: http://zzo38computer.cjb.net/xym/xymasm.flog
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.