Graphics library on NC200
Graphics library on NC200
Hi,
Is anyone using gfxnc200? I tried drawing something on NC200 using standard graphics library and it is only using 1/4 of the screen. Functions getmaxX and getmaxY are returning 479 and 127 but when I try to draw a line it is only using bottom left part of the screen:
Is anyone using gfxnc200? I tried drawing something on NC200 using standard graphics library and it is only using 1/4 of the screen. Functions getmaxX and getmaxY are returning 479 and 127 but when I try to draw a line it is only using bottom left part of the screen:
You do not have the required permissions to view the files attached to this post.
Re: Graphics library on NC200
As written elsewhere I'm close to a short holiday in the next week, so I can't check it very deeply.
The library was written quite a long ago, it could be just a matter of sorting the library make process.
If you have a full build environment, you could try by manually deleting all the ".o" files in the in libsrc/target/nc100/ folder and subfolders
Then run "make gfxnc200.lib" in /z88dk/libsrc and move the resulting ".lib" file in /c/z88dk/lib/clibs
The library was written quite a long ago, it could be just a matter of sorting the library make process.
If you have a full build environment, you could try by manually deleting all the ".o" files in the in libsrc/target/nc100/ folder and subfolders
Then run "make gfxnc200.lib" in /z88dk/libsrc and move the resulting ".lib" file in /c/z88dk/lib/clibs
Re: Graphics library on NC200
I will try! I have similar issue also in Z88 where I can also use just 25% of the screen and extending width beyond 64 pixels is messing up the screen. Not sure if this could be connected as it is different library?
Re: Graphics library on NC200
I'll see if I can run the nc200 example - I'm wondering if it's just using nc100 object files so gets the height completely wrong (no idea on the width at the momen, maybe it's ended up clamped to 256 pixels?)
The z88 is completely different library. On an unexpanded z88 you can't actually open up a map that's wider than 64 px. But who's running an unexpanded z88 these days? examples/z88/dstar.c uses the full map screen - does that work?
The z88 is completely different library. On an unexpanded z88 you can't actually open up a map that's wider than 64 px. But who's running an unexpanded z88 these days? examples/z88/dstar.c uses the full map screen - does that work?
Re: Graphics library on NC200
As Stefano suggested this was due to nc100 object files hanging around the place.
Re: Graphics library on NC200
I made Z88 working using this thread: https://www.z88dk.org/forum/viewtopic.p ... Z88#p21301 so all is good there but had no luck yet with NC200. Will try to rebuild gfxnc200/
Re: Graphics library on NC200
Tried but to no avail unfortunately... still stuck with 255x64
Re: Graphics library on NC200
I took gfxnc200.lib from the latest nightly builds, and tweaked showlib3d.c a little (it uses draw and I think that's what you're using?) and created this screenshot:
So the fix I applied to build the graphics libraries appears to have worked.
Disassembling the code shows that plot is clamped to 480x128 which is correct.
So the fix I applied to build the graphics libraries appears to have worked.
Disassembling the code shows that plot is clamped to 480x128 which is correct.
You do not have the required permissions to view the files attached to this post.
Re: Graphics library on NC200
Will download the latest build tomorrow morning and try the showlib3d.c - what did you tweak in the showlib?
Thanks
Michal
Thanks
Michal
Re: Graphics library on NC200
Code I was using follows. Hold down 1 to make the cube bigger and then any other key to redraw - getting a decent screenshot whilst it was refreshing was a bit annoying hence the “hold key down” thing.
Code: Select all
#include <lib3d.h>
#include <graphics.h>
#include <stdio.h>
#include <stdlib.h>
#define MX 240/2
#define MY 128/2
#define MX2 400
#define MY2 64
vector_t cube[8]
= { { -20 , 20, 20 },
{ 20 , 20, 20 },
{ 20 , -20, 20 },
{ -20 , -20, 20 },
{ -20 , 20, -20 },
{ 20 , 20, -20 },
{ 20 , -20, -20 },
{ -20 , -20, -20 } };
void main(void)
{
static vector_t rot;
static vector_t t;
static point_t p[8];
static unsigned c = 0;
static int i;
static int zf = 0;
while(c != 13) {
c=fgetc_cons();
switch(c) {
case '1':
zf -= 10;
if(zf < -100) zf = -100;
break;
case '2':
zf += 10;
if(zf > 300) zf = 300;
break;
case '3':
exit (0);
}
c = 0;
for(i = 0; i < 8; i++) {
ozcopyvector(&t,&cube[i]);
ozrotatepointx(&t, rot.x);
ozrotatepointy(&t, rot.y);
t.z += zf; /* zoom factor */
ozplotpoint(&t, &p[i]);
}
rot.y = (rot.y+1)%360;
rot.x = (rot.x+2)%360;
clg();
/* top face */
draw(p[0].x + MX, p[0].y + MY, p[1].x + MX, p[1].y + MY);
draw(p[1].x + MX, p[1].y + MY, p[2].x + MX, p[2].y + MY);
draw(p[2].x + MX, p[2].y + MY, p[3].x + MX, p[3].y + MY);
draw(p[3].x + MX, p[3].y + MY, p[0].x + MX, p[0].y + MY);
/* bottom face */
draw(p[4].x + MX, p[4].y + MY, p[5].x + MX, p[5].y + MY);
draw(p[5].x + MX, p[5].y + MY, p[6].x + MX, p[6].y + MY);
draw(p[6].x + MX, p[6].y + MY, p[7].x + MX, p[7].y + MY);
draw(p[7].x + MX, p[7].y + MY, p[4].x + MX, p[4].y + MY);
/* side faces */
draw(p[0].x + MX, p[0].y + MY, p[4].x + MX, p[4].y + MY);
draw(p[1].x + MX, p[1].y + MY, p[5].x + MX, p[5].y + MY);
draw(p[2].x + MX, p[2].y + MY, p[6].x + MX, p[6].y + MY);
draw(p[3].x + MX, p[3].y + MY, p[7].x + MX, p[7].y + MY);
/* top face */
draw(p[0].x + MX2, p[0].y + MY2, p[1].x + MX2, p[1].y + MY2);
draw(p[1].x + MX2, p[1].y + MY2, p[2].x + MX2, p[2].y + MY2);
draw(p[2].x + MX2, p[2].y + MY2, p[3].x + MX2, p[3].y + MY2);
draw(p[3].x + MX2, p[3].y + MY2, p[0].x + MX2, p[0].y + MY2);
/* bottom face */
draw(p[4].x + MX2, p[4].y + MY2, p[5].x + MX2, p[5].y + MY2);
draw(p[5].x + MX2, p[5].y + MY2, p[6].x + MX2, p[6].y + MY2);
draw(p[6].x + MX2, p[6].y + MY2, p[7].x + MX2, p[7].y + MY2);
draw(p[7].x + MX2, p[7].y + MY2, p[4].x + MX2, p[4].y + MY2);
/* side faces */
draw(p[0].x + MX2, p[0].y + MY2, p[4].x + MX2, p[4].y + MY2);
draw(p[1].x + MX2, p[1].y + MY2, p[5].x + MX2, p[5].y + MY2);
draw(p[2].x + MX2, p[2].y + MY2, p[6].x + MX2, p[6].y + MY2);
draw(p[3].x + MX2, p[3].y + MY2, p[7].x + MX2, p[7].y + MY2);
}
}
Re: Graphics library on NC200
Now we are in the business!
Before I used last night build: After using fresh build: And now I can play finally
Big thanks for help!
M
Before I used last night build: After using fresh build: And now I can play finally

M
You do not have the required permissions to view the files attached to this post.
Re: Graphics library on NC200
@dom: I see that you are using MAME for testing, what is the easiest way to load an NC100/200 program there? The wiki is missing this information.
@vagant: That maze game looks interesting!
@vagant: That maze game looks interesting!
Re: Graphics library on NC200
Because it’s small test programs I use the card8k subtype and then load it with -cart
We should be able to create an msdos disc that can be loaded but I’ve not needed it yet.
We should be able to create an msdos disc that can be loaded but I’ve not needed it yet.
Re: Graphics library on NC200
Ok, but is the MAME option really called -cart? Because that one isn't available for the nc200.
In the UI, you can only attach "printout" and "floppydisk", or the slot devices "centronics", "serial", "pcmia" and "fdc".
I'm using the latest MAME 0.278.
In the UI, you can only attach "printout" and "floppydisk", or the slot devices "centronics", "serial", "pcmia" and "fdc".
I'm using the latest MAME 0.278.
Re: Graphics library on NC200
For me on 0.250 it is:
But on 0.255 I can see that it's no longer present and it's been switched to pcmcia with only a couple of ram card options.
But on 0.255 I can see that it's no longer present and it's been switched to pcmcia with only a couple of ram card options.
You do not have the required permissions to view the files attached to this post.
Re: Graphics library on NC200
Also interested in MAME - just installed and also trying to upload ROM file. How do you get this File Manager window? TAB is not workng for me? Latest version of MAME 0.278
Re: Graphics library on NC200
OK, I can open but only such options available:
You do not have the required permissions to view the files attached to this post.
Re: Graphics library on NC200
Ah, the nc driver was completely rewritten here: https://github.com/mamedev/mame/commit/ ... b77acbecf5
That's annoying, I'll have to add floppy -subtype.
That's annoying, I'll have to add floppy -subtype.
Re: Graphics library on NC200
Does it mean there is no cart option anymore? I would prefer to simple run MAME and read the rom file rather than place the file in a disc image and read the disc? In this case it will be quicker to send the file to the real NC200 I guess using RS232 

Re: Graphics library on NC200
There seems to be a way to create bootable nc200 discs. I'll experiment and report back.
Re: Graphics library on NC200
Ok, I've just downloaded MAME 0.252, and this one still has the -cart option.
How do I run the ROM when it is attached? With the *LOAD command in BASIC, as it is described for the -ram subtype?
How do I run the ROM when it is attached? With the *LOAD command in BASIC, as it is described for the -ram subtype?
Re: Graphics library on NC200
I use alt-X from the menu to launch the cart.
Re: Graphics library on NC200
I've just pushed -subtype=floppy and more interestingly -subtype=ncboot options. The latter creates a bootable floppy image that can be launched from the menu using Function+R (LAlt+R).
For reasons that I'm not going to investigate, the floppy image can't be read with Mame250, but does work with Mame252 so hopefully it will also work with the latest.
Let me know how it goes and I'll write it up in the wiki.
Edit: -subtype=ncboot has an issue with graphics - they won't work and may crash the program. I'm working on a fix.
For reasons that I'm not going to investigate, the floppy image can't be read with Mame250, but does work with Mame252 so hopefully it will also work with the latest.
Let me know how it goes and I'll write it up in the wiki.
Edit: -subtype=ncboot has an issue with graphics - they won't work and may crash the program. I'm working on a fix.
Re: Graphics library on NC200
Excellent, that's easy to use with MAME 0.252.
The -subtype=ncboot created floppy image does work with the current 0.278 MAME, although the use of graphics (low-res in my case) currently makes the program crash, as you wrote.
However, the image can't be attached using -flop1 with 0.249, 0.250 or 0.252, it says: "Fatal error: Device 5.25" double density floppy drive load failed: Unable to identify the image format". I wonder if it is a problem that the created image is 720K in size?
Re: Graphics library on NC200
How would you create a floppy format with the file you want to run on NC200?