Monochrome Sprites not working on some Hires Targets
Monochrome Sprites not working on some Hires Targets
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).
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.
Re: Monochrome Sprites not working on some Hires Targets
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.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
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.
Re: Monochrome Sprites not working on some Hires Targets
Oops, I had +laser5000 in my batch file! :-)
Ok, so the -lgfxpc88 option is no longer required. Thanks, now it's working fine on that target.
Re: Monochrome Sprites not working on some Hires Targets
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.
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.
Re: Monochrome Sprites not working on some Hires Targets
Bondwell2 should be fixed from the next nightly as well.
Re: Monochrome Sprites not working on some Hires Targets
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.
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.
Re: Monochrome Sprites not working on some Hires Targets
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.
It should just set the UDGs up when you call clg()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).
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?3. Alphatronic PC
The effects of textcolor() and textbackground() are swapped.
Re: Monochrome Sprites not working on some Hires Targets
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
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");
[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.
Re: Monochrome Sprites not working on some Hires Targets
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.
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.
Re: Monochrome Sprites not working on some Hires Targets
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.
Re: Monochrome Sprites not working on some Hires Targets
Thanks, it's working fine! Here is Deepspace in 64x72:
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.
Re: Monochrome Sprites not working on some Hires Targets
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.
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.
Re: Monochrome Sprites not working on some Hires Targets
Much appreciated. Thumbs up for this and many other posts, Dom !
Re: Monochrome Sprites not working on some Hires Targets
And the answer is, it's always there! It's the default graphics resolution, so just don't link with -lgfxaq48
Re: Monochrome Sprites not working on some Hires Targets
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: 80x72:
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.
Here is a comparison between these two modes on the Aquarius:
80x48: 80x72:
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.