GFX9000 library 0.001

by msd on 14-01-2004, 22:17
Topic: Development
Languages:

Marcel Delorme has started development of a GFX9000 library. This library is coded in assembly and contains many useful routines which can be used in other assembly productions by other programmers. The first version doesn't contain many functions yet, but it can already be used. Marcel is looking for other coders who would like to help him extending this library. You can contact him at m.delorme@chello.nl

Relevant link: Marcel Delorme's website

Comments (26)

By BiFi

Enlighted (4348)

BiFi's picture

15-01-2004, 07:36

I have done some work on a Gfx9000 library system. I used the MSX BIOS list as a guide to code the routines and the screen mode routine is quite based on the V99x8 screen modes. I noticed routines already present in both (the most obvious ones), and there are routines that might be quite useful to add. I'll dig up and convert it to ASCII.

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 08:42

Though this might be nice to use as a 'black box' for beginning programmers, the amount of DEFINEs (equ's) and macro's in the source code give me a headache! It's like an entirely new language!

It's a matter of coding-style, I guess. Nevertheless, it's good work. Hopefully this, in combination with the Gfx9000 Programmers Manual will make Gfx9000 programming more popular!

By BiFi

Enlighted (4348)

BiFi's picture

15-01-2004, 09:35

Well, the library source I made has no macro's and not that many defines, is written in Compass and is in many ways MSX BIOS structured. Probably that source is somewhat more readable.

I too hope it will encourage more coders to make a start with programming for Gfx9000.

By msd

Paragon (1515)

msd's picture

15-01-2004, 09:53

GuyveR800, is that why tniasm doesn't support macros's :-)

By msd

Paragon (1515)

msd's picture

15-01-2004, 09:54

Macro's and defines make sources unreadable???

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 09:59

tniASM does support macro's, it's just that the version that's online doesn't.

And yes, too many macro's and defines make sources unreadable. I couldn't understand any of your sources... You have to first study (and really STUDY) the macro file to be able to understand it.

It's perfectly understandable to you, because you wrote it.. And apparently you like the system, but I only know C coders that use your system...

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 10:01

Also, programming with DEFINE's like this move you (the coder) away from the hardware, because you don't know what's going on exactly. You just know that if you put so and so macro's together, something will (or should) happen the way you want it.

I don't like it... But as I said, it's a matter of preference...

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 10:03

Not to mention the HUGE amount of TYPING involved.
Writing OUT (64h),A is so much shorter than OUT (G9K_REG_SELECT),A

By msd

Paragon (1515)

msd's picture

15-01-2004, 10:04

what is to study about a line like this?
G9kWriteReg G9K_REG_OPCODE,G9K_OPCODE_STOP

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 10:08

Reading it is one thing, but if you have to write it you have to memorize all the macros and all the defines...

By msd

Paragon (1515)

msd's picture

15-01-2004, 10:14

I hope other coders see the benifits of readable code else it has no use of publishing this lib.

By BiFi

Enlighted (4348)

BiFi's picture

15-01-2004, 10:47

Come on you guys. We should be glad there is something ready to use to program for the Gfx9000. Don't kill this effort by argueing about coding style and readabilty of sources. Maybe people are kinda forced to use a particular assembler now, but the source can always be adapted to use with any other assembler. And it's not that a newbie coder immediately wants to start coding for Gfx9000. I'm sure he/she would like to check some easier things with the V99x8 VDP before wanting to code for Gfx9000 or other external hardware.

By msd

Paragon (1515)

msd's picture

15-01-2004, 11:01

With only a few modifications the code can also be compiled with compass

By anonymous

incognito ergo sum (116)

anonymous's picture

15-01-2004, 11:02

Apparently I can't even give my *personal opinion* about stuff anymore without people threatening to cancel it.
I had no intention of starting an evangelism about coding style, all I said was it's not my cup of tea.

By msd

Paragon (1515)

msd's picture

15-01-2004, 11:13

I'm making this lib anyway, not threatening to stop it or so. But I've more coders think like you there is no point of making it public. Saves me making a manual Smile

By snout

Ascended (15187)

snout's picture

15-01-2004, 12:53

I'm looking forward to a library like this, gives me the opportunity to play with the GFX9000, even though I have limited coding skills. However, I must admit that long names like GF9K_REG_OPCODE_OUT_STOP_NO_THIS_IS_WAY_TOO_LONG don't always add to the readability of code. If more developers join this library project, I'm sure you will be capable to find the perfect middle way. A library like this will -highly- contribute to the amount of GFX9K software out there (which needs a boost indeed!). Keep up the good job!

By ro

Scribe (4963)

ro's picture

15-01-2004, 13:14

Guyver is right on the 'new language' stuff here.
I, personally, never use too many defines and certainly NEVER macros. Thaz what makes ASM unique. The few instructions you have and the lack of pre defined routines (e.g. a standard I/O file etc)

Even so with include files, they do not add any readability to the source.
if I write: OUT (9AH),A.. it's not only quicker to type but also, every body sees what's going on, on the spot. something like

write_accu_to_io_port (some_VDP_port_reg)

that would rais more questions... (WHAT does it do??) you have to skip back to the macro and definition part to actually see what's been done here.

Oh, how about 6-string label lenght?? (ah, never mind)

By Arjan

Paladin (787)

Arjan's picture

15-01-2004, 14:12

this style is ok with me Smile I'd rather type some predefined name instead of remembering the corresponding register number. It's also less error-prone; if you type a name incorrectly you'll get an error, whereas an incorrect registernumber will result in a bug.

By msd

Paragon (1515)

msd's picture

15-01-2004, 14:41

Thanx dude Smile

By Grauw

Ascended (10768)

Grauw's picture

15-01-2004, 16:45

I use a couple of macro's and defines, but not too many, I guess... for v9958, I have VDP_SetReg n, which sets the value of A in register n as a macro. On v9990, uh, lemme see... Ah, seems I have a VDP9_SetReg aswell, contains LD A,n : OUT (#64),A. As for the rest I do use out's and the register numbers in my code though. I think I tried using things like OUT (V9PORT+4),A before but in the end just memorizing and writing down the actual port numbers seemed easier.

Generally, I use macro's only to save space, which keeps my sources more clear. I for example also have a macro Wait_HBLANK, which does two polls for the HR bit. If I could have gotten it to work, I'd also have created an LD_x rr,rr macro, I hate them LD H,D : LD L,E sequences. I usually keep the use of them macro's and defines limited though. I do use CALL BDos instead of CALL 5, and the proper DOS2 function call names, and LD IY,(EXP_TABLE-1) instead of LD IY,(#FCC0), however in a copy command I just use #D0 and not VDP_COM_HMMM or something similar. In the source, the meaning is clear through the command's label name, and if nessecary some comments. And change isn't very often needed anyway. But then again, I always keep my VDP course (by Stefan Boer) handy for referral.

Anyways, everyone codes in a different manner. Some parts of Guyver's coding style also very much give me a headache... ;p Well, ok not that Smile, but there are things I would definately program differently.

~Grauw

By Grauw

Ascended (10768)

Grauw's picture

15-01-2004, 16:59

p.s. if someone feels urged to write a(n) article(s) for the MAP, then feel free to contact me!

~Grauw

By d-fader

Champion (293)

d-fader's picture

15-01-2004, 17:54

One uses WAY_TOO_LONG_DEFINES_FOR_HIS_CODE and another one doesn't use any defines, the first is more unreadable, the second is a pain in the ass to update...
More developers should join creating this library and somewhere in the middle, ...I dunno, you'll figure it out Smile
Good job, though most people don't (yet) own a GFX9k, that's quite sucky...

By Grauw

Ascended (10768)

Grauw's picture

15-01-2004, 18:24

Since Sunrise reduced prices they're much better affordable, though. I have one now since Tilburg 2002, and I must say it's a cool toy Smile. All software I have development plans for will make use of it... usually by means of a 'double engine', meaning you can run the game with either a v9958 or a v9990.

~Grauw

By msd

Paragon (1515)

msd's picture

15-01-2004, 18:37

No that everbody has given their opinion on macro's and defines. The question remains: Who wan't to join developing this lib?

By snout

Ascended (15187)

snout's picture

16-01-2004, 00:45

Shouldn't you ask another question as well? Namely: Who are going to use this lib?? (me! me! Smile)

By Manuel

Ascended (19466)

Manuel's picture

17-01-2004, 00:21

msd: keep up the good work!
And I do like the use of readable macros! I can't memorize all those ports or other constants...

And I will definately use it, after we have added the C-wrappers! Smile