Welcome, Guest. Please login or register.


Author Topic: TommyGun Developer Studio (Read 24595 times)

Offline Bagpuss22

  • EP fan
  • *
  • Posts: 163
  • Country: gb
    • View Profile
TommyGun Developer Studio
« on: 2007.February.01. 11:18:46 »
Hi all, again!

Thought you might be interested in an 8 bit developer studio that I have been playing
with...  TommyGun.

TommyGun Developer Studio

He intends to add the Enterprise as an available machine and I have been supplying him
with information as he owns 3 Enterprise 64's! :razz:

Anyway have a look, looking good.

regards

Russ P. :)

Online Zozosoft

  • EP addict
  • *
  • Posts: 13502
  • Country: hu
    • View Profile
    • http://enterprise.iko.hu/
Re: TommyGun Developer Studio
« Reply #1 on: 2007.February.01. 11:24:08 »
Great!
If he have any questions about the Enterprise we try to help!

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #2 on: 2007.February.19. 12:47:50 »
Hi all,

I'm TommyGun's author, my name is Tony.
Bagpuss22 asked me to add Enterprise support for you all.
I would love to do this but I need some specific information from you all to do it.
I was wondering if you could provide me with the following screen mode information.

1. The number of screen modes - ie. Low Res, Hi Res etc
2. Dimensions of each mode
3. Number of colours per mode
4. The default palette for each mode - ie. the RGB for each colour in the palette and what ones the modes default
5. And the display mode names (ie. what you want to see in the display list combo box)

eg for a CPC 464 the above is
1. 3
2.
Mode 0 160x200
Mode 1 320x200
Mode 2 640x200
3.
Mode 0 - 16 Colours from 27
Mode 1 - 4 from 27
Mode 2 - 2 from 27
4. Palette same for all modes
RGB
1 - 0,0,0
2 - 0,0,127
...
27 - 255,255,255
5. CPC Mode 0, CPC Mode 1, CPC Mode 2

If could supply me with all or even some of this information I would be very grateful.

Now I know you can mix modes per scanline and that you can change the colours per scan line.
But PLEASE if you could just give me the standard display modes that would be a great start.

Thank you for your help.

Cheers,
   Tony

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #3 on: 2007.February.19. 12:51:53 »
Oh and by the way I will gladly take an Enterprise 128 as payment! ;)
***hint hint*** :)




Seriously no payment is required, but if someone would like to point me in the direction of a nice boxed 128, that would be nice. :)
One that is not in Hungary and requires a direct bank deposit to purchase, but paypal accepted ones would be preferred.

Cheers

Online Zozosoft

  • EP addict
  • *
  • Posts: 13502
  • Country: hu
    • View Profile
    • http://enterprise.iko.hu/
Re: TommyGun Developer Studio
« Reply #4 on: 2007.February.19. 16:06:38 »
I'm TommyGun's author, my name is Tony.
Welcome here!

Quote from: Kiwi
I was wondering if you could provide me with the following screen mode information.
Very hard answering to your questions, because the Nick chip (graphical chip of the Enterprise) are very flexible.
Nick documentations.
For example you can programming the Nick for displaying any CPC 464 modes, or attribute graphics of the ZX Spectrum and many more!


Quote from: Kiwi
1. The number of screen modes - ie. Low Res, Hi Res etc
-Pixel graphics mode.
-Low Res pixel graphics mode
-Attribute graphics mode (similiar to the ZX Spectrum graphics)
-Character 64 mode
-Character 128 mode (most commonly used character mode)
-Character 256 mode

Quote from: Kiwi
3. Number of colours per mode
You can select 2,4,16,256 color modes for pixel graphics modes
At the 256 colors mode, you use directly the 256 colors.
At the 2,4,16 colors you need to use palette colors.
The palette define 8 colors. All palette color can be any of the 256 colors.
In a 2 colors mode you use the first 2 color from the palette, in a 4 colors mode you use the first 4 colors.
In a 16 colors mode use all of 8 colors of the palette, and the second 8 colors defined by the FIXBIAS register.
The FIXBIAS select one 8 colors block from the 256 colors, this means, the col7-col15 in the 16 colors mode can be a 0-7 or 8-15 or 16-23,etc

The attribute graphics mode use 16 colors.
The character modes are more complicated, now I only write the most popular, definied by the operating system. This is a Character 128 mode, can display 4 colors: character code 0-127 displayed with the first two colors of the palette, character codes 128-255 displayed with the second two.

The border can be display any of the 256 colors.

Quote from: Kiwi
2. Dimensions of each mode
This is the hardest question! :-)
At the default character mode you can write 40 characters to each line.
Horizontaly one character lenght is the minimal display size.
At Hi-Res graphics, 2 colors mode: one character size means 16 pixels horizontaly.
You can define about 1-44 character wide screen, more than 42 then: no border visible
For example: emulate CPC video modes, then need to use 40 characters wide screen, emulating ZX Spectrum Screen: 32 characters wide.

The resolutions:
If you use the standard 40 characters wide screen at the hi-res 2 colors graphics, then you got 640 pixels horizontaly.
The Lo-res is a half of the Hi-res: 40 characters wide lo-res 2 colors: 320 pixels horizontaly.
If you double the numbers of the colors, the the resolution go down to half.
Summary horizontal resolutions (using 40 characters wide screen):
HIRES 2: 640
LORES 2: 320
HIRES 4: 320
LORES 4: 160
HIRES 16: 160
LORES 16: 80
HIRES 256: 80
LORES 256: 40
Attribute graphics: 320

The vertical resolution, not affected by the video modes or colors.
You can define the vertical size from 1 line to about 260-270 lines. The empty are is filled with the border color. If you define about the maximum size screen, you can totaly hide the border. (The operating system define 252 lines.)

Some examples for summary: 640x200 2 colors, 640x240 2 colors, 320x200 4 colors, 320x240 4 colors, etc can be used on the Enterprise.

Quote from: Kiwi
4. The default palette for each mode - ie. the RGB for each colour in the palette and what ones the modes default
No default palette. When you generate the Line Parameter Table, then you define them. But if you want, I can write what is default definied colors by the OS.
In the Nick documentations, you can see generated the colors, if you want I will calculate the 24 bit RGB code of each Enterprise color.

Quote from: Kiwi
5. And the display mode names (ie. what you want to see in the display list combo box)
The commonly used names comes from the IS-BASIC:
GRAPHICS HIRES 2
GRAPHICS LORES 2
GRAPHICS HIRES 4
GRAPHICS LORES 4
GRAPHICS HIRES 16
GRAPHICS LORES 16
GRAPHICS HIRES 256
GRAPHICS LORES 256
GRAPHICS ATTRIBUTE
TEXT 40 (this is the character mode, using character 128 mode of the NICK chip)

(TEXT 80 is exist in the BASIC/OS but it is not a HW character mode, use Graphics Hires 2 mode, and the OS copy the pixel datas from the character map to the graphics memory)
« Last Edit: 2007.February.19. 16:12:05 by Zozosoft »

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #5 on: 2007.February.20. 04:10:53 »
WOW!!!

Ok, so maybe I need to narrow things down a little.
One of the main elements of TommyGun is the Image Editor.
So to output Enterprise compatible images (sprites/tiles etc) to the code editor I need to know the display formats.
So then since the nick display chip is SO flexible, then I won't concentrate on display modes specifically, but their color depth instead.
Since the display uses a palette then this implies that the display memory is organized into bytes that reference the displays palette.
ie. for 256 colors - 8 bits/color, 16 colors - 4 bits/color 2 pixels per byte, 4 colors - 2 bits/color 4 pixels per byte etc.
Now the CPC has a strange bit arrangement for the display - does the Enterprise have a likewise strange arrangement?
ie. A normal 16 color 4 bits/pixel paletted display would have the first color in the lower 4 bits and the second color in the higher 4 bits - where as the CPC has them interlaced - ie. first color - odd bits and second color even bits.

Why is this important?
Well when you transfer your image into the Code Editor the resource converter needs to know how to arrange the color bits so that the image will display correctly for your computer (Enterprise).
You see the image editor stores the images in a computer independent way - thus allowing me to support any possible computer not just one as in most editors.
Basically - how do you store your sprite data when making a game for 256/16/4/2 color modes?

So then to continue I need the pixel bit arrangements for each possible color mode.
ie. bits for 256 colors, 16 colors, 4 colors and 2 colors (monochrome).

Does that make any sense? :)

Cheers

Online Zozosoft

  • EP addict
  • *
  • Posts: 13502
  • Country: hu
    • View Profile
    • http://enterprise.iko.hu/
Re: TommyGun Developer Studio
« Reply #6 on: 2007.February.20. 10:57:30 »
Since the display uses a palette then this implies that the display memory is organized into bytes that reference the displays palette.
ie. for 256 colors - 8 bits/color, 16 colors - 4 bits/color 2 pixels per byte, 4 colors - 2 bits/color 4 pixels per byte etc.
Now the CPC has a strange bit arrangement for the display - does the Enterprise have a likewise strange arrangement?
ie. A normal 16 color 4 bits/pixel paletted display would have the first color in the lower 4 bits and the second color in the higher 4 bits - where as the CPC has them interlaced - ie. first color - odd bits and second color even bits.
Ok, this is easy question :-)
In the 2,4,16 colors modes the Enterpise use totaly same bit arrangement with the CPC! (because this, easy to convert CPC games to Enterprise)
256 colors mode are very simple: one byte one pixel.
Attribute graphics mode: the pixel data stored similiar with the 2 colors mode. For one pixel data byte (8 pixels) one attributum byte, this select the back and foreground colors for these 8 pixels area, from a 16 colors palette. The attributum byte format is simple: low 4 bits the foreground, high 4 bits the background. This is totaly same with the ZX Spectrum display method. (But on Enterprise you can use standalone attributes for each pixel lines)

At the Character modes: the display area contains the character codes, and the Nick get the pixel datas from the character set and display them. In the character set the pixel datas stored as the 2 colors graphics mode, one character is a 8 pixels wide. In the character set memory firstly stored the first lines of the each characters, next the second lines of each characters, etc
The operating system (and the most of programs) using 128 charcters set, 9 lines height.
« Last Edit: 2007.February.20. 10:59:51 by Zozosoft »

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #7 on: 2007.February.20. 11:12:57 »
Thanks Zozosoft.

I didn't notice the nick document link in your first post and so I visited that and have most of the info I need.
Just a note though, I won't be including the text modes in TommyGun as the image editor only requires the pixel and attribute modes.

I checked the nick document and the bit layout for the 2/4/16 color modes is not the same as the CPC, its the same/similar to a EGA/VGA display.

It seems that there is no real byte value difference between lo-res and hi-res pixel mode.
ie. a 16 colour byte displays exactly the same on lo-res as it does in hi-res only in hi-res mode there are twice as many display bytes.
So what I will do is base the Enterprise image modes based on the number of colors required for an image. eg 2/4/16 and 256 colors.
As for the screen tab in the image editor I will make the setting configurable by the user.

I should have an update for TommyGun and for the Enterprise community to try hopefully by the weekend.

I must say thank you for the assistance so far as you have replied faster and with more information than any other retro machine fan site.

Also one other question:
What assembler and emulator is best?
I use pasmo and have downloaded EP32.

The only thing I require now is the list of all 256 color RGB values :-)
you can email them to  TommyGun.IDE AT gmail.com

THANKS!!!

Online Zozosoft

  • EP addict
  • *
  • Posts: 13502
  • Country: hu
    • View Profile
    • http://enterprise.iko.hu/
Re: TommyGun Developer Studio
« Reply #8 on: 2007.February.20. 12:31:28 »
I checked the nick document and the bit layout for the 2/4/16 color modes is not the same as the CPC, its the same/similar to a EGA/VGA display.
I think you misreaded anything.
The bit order is same with the CPC!
CPC:

Enterprise:



Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #9 on: 2007.February.20. 12:49:02 »
Oops - you are right I miss read it  :oops:
Well that makes it easy as I already have CPC support in TommyGun I just need to make some Enterprise versions :D

Online Zozosoft

  • EP addict
  • *
  • Posts: 13502
  • Country: hu
    • View Profile
    • http://enterprise.iko.hu/
Re: TommyGun Developer Studio
« Reply #10 on: 2007.February.20. 13:42:42 »
Also one other question:
What assembler and emulator is best?
I use pasmo and have downloaded EP32.
Yes, the EP32 is good. If you have any questions to use it, let's ask!

Offline MrPrise

  • Administrator
  • EP addict
  • *
  • Posts: 2533
  • Country: hu
    • View Profile
    • Enterprise Forever
Re: TommyGun Developer Studio
« Reply #11 on: 2007.February.20. 15:54:04 »
I should have an update for TommyGun and for the Enterprise community to try hopefully by the weekend.
Thank you!


Quote
The only thing I require now is the list of all 256 color RGB values :-)
It is easy to generate:

Code: C
  1. #define RED(x)   ((x&1)<<2)+((x&8)>>2)+((x&64)>>6)
  2. #define GREEN(x) ((x&2)<<1)+((x&16)>>3)+((x&128)>>7)
  3. #define BLUE(x)  (((x&4)>>1)+((x&32)>>5))
  4.  
  5. void Generate_EP_Colors()
  6. {
  7.   uint8_t R_comp,G_comp,B_comp;
  8.   int Colour;
  9.   uint8_t Level_8[8] = { 0, 37, 73, 110, 146, 183, 220, 255 };
  10.   uint8_t Level_4[4] = { 0, 86, 172, 255 };
  11.  
  12.   for (Colour = 0; Colour < 256; Colour++)
  13.   {
  14. // Of course, you should store these values ;-)
  15.     R_comp = Level_8[RED(Colour)];
  16.     G_comp = Level_8[GREEN(Colour)];
  17.     B_comp = Level_4[BLUE(Colour)];
  18.   }
  19. }
  20.  
« Last Edit: 2007.February.20. 16:01:09 by MrPrise »

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #12 on: 2007.February.20. 22:37:24 »
Excellent - Thanks!  :mrgreen:

Your order of Software should be ready by the weekend for sure - would you like fries with that? :) (Bad McDonalds joke ;) )

Thanks everyone!

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #13 on: 2007.February.24. 01:53:40 »
Ok, its ready
get it at http://www.users.on.net/~tonyt73/TommyGun/

You can create Enterprise images (in 2/4/16 or 256 colours), use them in the map editor and translate them into code in the code editor.
Sorry no music support yet :( but don't feel leftout because no machine has it yet ;)

Any questions either post here or email the tommygun email address

I hope you enjoy using TommyGun.

Cheers

Offline Kiwi

  • Beginner
  • *
  • Posts: 29
  • Country: au
    • View Profile
Re: TommyGun Developer Studio
« Reply #14 on: 2007.February.24. 04:12:27 »
Oops I made a small mistake in the installer.
If your installer doesn't show the Enterprise plugins as an install option then please re-download
Sorry for the inconvience.