Monochrome Sprites not working on some Hires Targets

Bug reports (if you don't/won't have a Github account)
Post Reply
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Monochrome Sprites not working on some Hires Targets

Post by RobertK »

While working on my new game Deepspace, I noticed that on a few hires-capable targets monochrome sprites are not working.
It could be that they are not implemented yet on some of these targets, but hopefully some are currently broken and easy to fix.

I've made a little test program named grtest.c, compile it for the PV-2000 to see what the result should look like.

Here are the targets with issues:

RX-78 and PC-6001 MK2: Sprites are invisible

PC-8801: Compilation Error "Cannot read file 'gfxpc88.lib'"

Microbee (Premium Models): Neither graphics primitives nor sprites appear.

Robotron Z9001 KRT: Basically everything (including sprites) is working, obviously an external font is required.
However, -pragma-redirect:CRT_FONT=_font_8x8_zx_system gives this compilation error:
Error at file ...zcc_opt.def' line 14:
symbol '_font_8x8_zx_system' not defined
symbol 'CRT_FONT' not defined

Laser 500: Basically everything is working (using the nigthly from 2021-12-25), but XOR-moved sprites leave a few white pixels behind them.
With the nightly build from 2022-01-06, there is now this compilation error:
Can't open config file C:\Misc\z88dk\lib\config\/laser5000.cfg

Bondwell 2: grtest.c crashes immediately and makes the system reboot (using the nigthly from 2021-12-25). With the nightly build from 2022-01-06, there is no crash anymore, but the screen is broken (text is at a wrong position, neither graphics primitives nor sprites appear).
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

Laser 500: Basically everything is working (using the nigthly from 2021-12-25), but XOR-moved sprites leave a few white pixels behind them.
With the nightly build from 2022-01-06, there is now this compilation error:
Can't open config file C:\Misc\z88dk\lib\config\/laser5000.cfg
This should now be sorted: we weren't saving the current paging setup, so the interrupt was restoring the wrong page half way through a graphics routine.

Have you got a typo in your batch file?

PC-88: zcc +pc88 grtest.c -create-app -subtype=disk -pragma-redirect:CRT_FONT=_font_8x8_bbc_system produces a working disk image. The pc88 code was rewritten last February/March and the extra library was removed and hopefully also from the docs.

RX78: xorplot just doesn't work, this one has got slightly funky graphics hardware (6 graphics planes!) so let me figure out how to do it!

The others I'll investigate and post back when I've got them working.

Thanks again for another great testing program.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by RobertK »

dom wrote: Sat Jan 08, 2022 5:26 pm Have you got a typo in your batch file?
Oops, I had +laser5000 in my batch file! :-)
dom wrote: Sat Jan 08, 2022 5:26 pm PC-88: zcc +pc88 grtest.c -create-app -subtype=disk -pragma-redirect:CRT_FONT=_font_8x8_bbc_system produces a working disk image. The pc88 code was rewritten last February/March and the extra library was removed and hopefully also from the docs.
Ok, so the -lgfxpc88 option is no longer required. Thanks, now it's working fine on that target.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

I've now fixed up pc88 (again - you'll now get white rather than green sprites), pc6001 (but use the mk2 emulator because the original is painfully slow) and rx78.

Robotron 9001 is interesting: I never added support for the graphics card with the generic console, so I'll have to write some code to support that!

Bondwell2 is keeping me occupied at the moment. The crash seems to be due to a disc NMI happening whilst we're in the middle of drawing the screen. I've got a temporary patch around for it. Getting the display in the right position is proving elusive, I remember having some fun with this in the past, I'm trying to remember the correct magic to reset the viewpoint window.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

Bondwell2 should be fixed from the next nightly as well.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by RobertK »

More issues:

1. CPC

a) When using Screen Mode 1 (320x200), the screen is in 640x200, getmaxx() returns 639.

b) gfx_set_fatpix(1) has no effect (tested with screen mode 2 in an attempt to turn this into 320x200).

c) The graphics screen is drawn in black on white. Can this be somehow inverted to white on black? Using...
textcolor(WHITE);
textbackground(BLACK);
...has no effect.


The following two are a little off-topic because they affect low-res graphics:

2. Jupiter Ace

64x48 mode (-lgfxace) works, but 64x72 mode (-lgfxaceudg) doesn't. I've tested it in the EightyOne emulator (I assume there is no hardware setting required to activate UDG on the Ace, at least I haven't found any).


3. Alphatronic PC

The effects of textcolor() and textbackground() are swapped.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

RobertK wrote: Sun Jan 23, 2022 8:49 am More issues:

1. CPC
CPC doesn't have harmonised graphics and so always plots in the 640x200 screen mode. Now you've found it, I guess I ought to extend the target a bit.
2. Jupiter Ace

64x48 mode (-lgfxace) works, but 64x72 mode (-lgfxaceudg) doesn't. I've tested it in the EightyOne emulator (I assume there is no hardware setting required to activate UDG on the Ace, at least I haven't found any).
It should just set the UDGs up when you call clg()

3. Alphatronic PC

The effects of textcolor() and textbackground() are swapped.
That's odd, the underlying code looks like it's correct according to the mame source code - was it just graphics or text as well?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by RobertK »

dom wrote: Sun Jan 23, 2022 10:23 am 2. Jupiter Ace
It should just set the UDGs up when you call clg()
I'm already doing clg() after switching screen modes:

Code: Select all

#if defined(SCREEN_MODE_GRAPHICS)
	// switch to hires mode
		mode = SCREEN_MODE_GRAPHICS;
		console_ioctl(IOCTL_GENCON_SET_MODE, &mode);
	#endif
	
	#if defined(__PC88__) || defined(__MULTI8__) // || defined(__CPC__)
		gfx_set_fatpix(1);	// doubles the pixels horizontally, which turns 640x200 into 320x200
	#endif

	#if !defined(DO_NOT_USE_CLG)
		clg();  // activate graphics mode
	#endif
The result when using -lgfxaceudg looks like this:

grtest_Ace_64x72.jpg
dom wrote: Sun Jan 23, 2022 10:23 am 3. Alphatronic PC
That's odd, the underlying code looks like it's correct according to the mame source code - was it just graphics or text as well?
Both text and graphics, the Alphatronic low-res graphics is character based.

When doing this...

Code: Select all

	textcolor(WHITE);
	textbackground(RED);
	printf("R");
	textcolor(WHITE);
	textbackground(GREEN);
	printf("G");
	textcolor(WHITE);
	textbackground(BLUE);
	printf("B");
	textcolor(WHITE);
	textbackground(MAGENTA);
	printf("M");
	textcolor(WHITE);
	textbackground(CYAN);
	printf("C");
	textcolor(BLACK);
	textbackground(WHITE);
	printf("W");
...the result looks like this [EDIT: in Mame 0.239]:

ColourTest_Alphatronic.jpg
[EDIT: I just found out that something must have changed with that target recently in MAME, because in 0.228 it looked correct with a black background, but now in 0.239 you have a white blackground and bg/fg colour swapped!]

Attached are modified test programs for these three targets.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

Thanks, it's worth describing what's happening with the ace and the limitations.

The PCG area for the Ace is 128 characters, creating the 2x3 block graphics uses 64 of them. At the moment this overwrites characters 0-63 which takes out the space character. The myCls() path is filling the screen with code 32, which actually ends up being a graphic.To make life even more fun.

Given the awkwardness, I think that mode needs a bit of rework so there's a bit more compatibility.

The Alphatronic issue now has me confused, I'm wondering if we've run into a mame issue or we've inadvertently managed to set the inverse flag for the whole screen.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

I've reworked the Ace graphics mode so that only 32 UDGs are needed so none of the regular font is overwritten - hopefully it will be useful enough for you.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by RobertK »

dom wrote: Mon Jan 24, 2022 8:56 pm I've reworked the Ace graphics mode so that only 32 UDGs are needed so none of the regular font is overwritten - hopefully it will be useful enough for you.
Thanks, it's working fine! Here is Deepspace in 64x72:

Deepspace_JupiterAce.jpg
But I wonder if I shall release these lo-res system versions, they are hardly playable. Maybe I will include them "for demonstration only". One day I should make a version of the game with smaller sprites for these targets.

Another low-res issue: according to the platforms wiki page, the Mattel Aquarius should have 80x72 graphics, but grtest.c reports 80x48. Can the 80x72 mode somehow be activated, or is this an error on the wiki page?
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

I think there must have been attempt at a better resolution for the Aquarius, but it looks like the library is no longer built, I can't find a log regarding why it was removed.

We've still got the character table (which is most of the effort!) so I'll see if I can create a library/see what it looks like.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by stefano »

Much appreciated. Thumbs up for this and many other posts, Dom !
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by dom »

dom wrote: Tue Jan 25, 2022 9:25 am I think there must have been attempt at a better resolution for the Aquarius, but it looks like the library is no longer built, I can't find a log regarding why it was removed.
And the answer is, it's always there! It's the default graphics resolution, so just don't link with -lgfxaq48
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: Monochrome Sprites not working on some Hires Targets

Post by RobertK »

Excellent, thanks! I've seen that you have made it clearer on the wiki platform page.

Here is a comparison between these two modes on the Aquarius:

80x48:
Deepspace_Aquarius_80x48.jpg
80x72:
Deepspace_Aquarius_80x72.jpg

I think that I will release the game for low-res targets with 72 lines graphics, although the screen very quickly fills up with rocks, but it is still fun to play. Any lower resolution is pretty much unplayable.
You do not have the required permissions to view the files attached to this post.
Post Reply