(classic) New target: Triumph Adler/Royal Alphatronic PC
(classic) New target: Triumph Adler/Royal Alphatronic PC
At the request of RobertK I've added Alphatronic PC support.
* Z80 @ 4 Mhz
* 64k RAM, 24k ROM + 4k chargen
* HD46505SP (aka mc6845) as CRTC
Although the machine has got 64k of RAM, I've not investigated the disc interface so we can't use all of it! As a result, z88dk is limited to generating 16k ROMpack cartridges.
In terms of support:
* Generic console
* Inkey keyboard driver
So text based programs should work okay. The native character set is exposed through the console so you can print "semi-graphics"
Planned:
* Lores graphics (I think 80x75) - the pixels will be uneven since the font is 8x10 pixels divided into 3 vertical pixels
Not working (on emulator):
* Switching to mode 1 should switch to 80 column mode, but mame doesn't seem to support it.
* Z80 @ 4 Mhz
* 64k RAM, 24k ROM + 4k chargen
* HD46505SP (aka mc6845) as CRTC
Although the machine has got 64k of RAM, I've not investigated the disc interface so we can't use all of it! As a result, z88dk is limited to generating 16k ROMpack cartridges.
In terms of support:
* Generic console
* Inkey keyboard driver
So text based programs should work okay. The native character set is exposed through the console so you can print "semi-graphics"
Planned:
* Lores graphics (I think 80x75) - the pixels will be uneven since the font is 8x10 pixels divided into 3 vertical pixels
Not working (on emulator):
* Switching to mode 1 should switch to 80 column mode, but mame doesn't seem to support it.
Many, many thanks for this new target! I've got my game already running on it, only keyboard input is not fully working yet. For some reason, kbhit() and getch() work in the menu, but not inside the game loop. I assume that I will have to use in_inkey() instead.
P.S. To explain why I am interested in the Alphatronic PC: as a kid I saw it in a catalogue and dreamed of having one. It looked so cool, and from my dad's typewriter I knew that Triumph-Adler was a company that made only "serious business stuff". Fortunately I never got one, because I would have been *very* disappointed due to the lack of software and being absolutely the only kid in my area with that machine. :-)
Besides, it was very expensive compared to other computers of that era. I still own that catalogue, I will have to dig it out again.
P.S. To explain why I am interested in the Alphatronic PC: as a kid I saw it in a catalogue and dreamed of having one. It looked so cool, and from my dad's typewriter I knew that Triumph-Adler was a company that made only "serious business stuff". Fortunately I never got one, because I would have been *very* disappointed due to the lack of software and being absolutely the only kid in my area with that machine. :-)
Besides, it was very expensive compared to other computers of that era. I still own that catalogue, I will have to dig it out again.
That's bizarre behaviour, it really shouldn't matter where they're called from! Can you share some source and I'll investigate.
On that target, kbit() ends up calling in_Inkey() in anycase. kbhit() internally uses a variable, so if that was overwritten with 0 every time round the loop then you'd see that behaviour - where does "kbhit_key" end up in the memory map? (Compile with -m)
On that target, kbit() ends up calling in_Inkey() in anycase. kbhit() internally uses a variable, so if that was overwritten with 0 every time round the loop then you'd see that behaviour - where does "kbhit_key" end up in the memory map? (Compile with -m)
Here is a little test, first try it on the ZX81 to see to desired behaviour.
On the Alphatronic PC, it seems that kbhit() does not work when there is frequent printing (or plotting) inside the loop.
On the Alphatronic PC, it seems that kbhit() does not work when there is frequent printing (or plotting) inside the loop.
Code: Select all
// Compile with
// zcc +zx81 -startup=2 -o kbhittest_ZX81 -create-app kbhittest.c
// zcc +vg5k -lm -o kbhittest_vg5000 -create-app kbhittest.c
// zcc +aquarius -lm -o kbhittest_aquarius -create-app kbhittest.c
// zcc +alphatro -o kbhittest_alphatronic -create-app kbhittest.c
#include <stdio.h>
void main()
{
char c;
int exitLoop;
printf("%c",12); // clear the screen
printf("\nkbhit() test\n");
printf("\n\nfirst loop\npress n, or x to exit loop\n\n");
exitLoop=0;
do
{
if(kbhit())
{
c = getch();
if (c=='n' || c=='N') printf("\nkey n pressed");
if (c=='x' || c=='X') exitLoop=1;
}
}
while(exitLoop==0);
printf("\n\nsecond loop\n\n");
exitLoop=0;
do
{
printf("\npress n, or x to exit loop");
if(kbhit())
{
c = getch();
if (c=='n' || c=='N') printf("\nkey n pressed");
if (c=='x' || c=='X') exitLoop=1;
}
}
while(exitLoop==0);
printf("\n\ndone.");
fgetc_cons();
printf("%c",12); // clear the screen
return;
}
Thanks for the snippet I think I understand what's going on - it's to do with key debounce.
There's a counter that decrements everytime in_GetKey() (which is called by getk() which is called by kbhit()) is called.
Thus it's only picking up a keypress every 256 calls to kbhit() which when you're printing on a screen isn't very often.
I'm not sure why it's working on the zx81 - it must have different initial debounce values, I'll need to investigate and tune the values.
There's a counter that decrements everytime in_GetKey() (which is called by getk() which is called by kbhit()) is called.
Thus it's only picking up a keypress every 256 calls to kbhit() which when you're printing on a screen isn't very often.
I'm not sure why it's working on the zx81 - it must have different initial debounce values, I'll need to investigate and tune the values.
I can only say that among all targets that my game supports, only the Alphatronic PC seems to be affected by this. Until the recent in_KeyPressed() additions I have been using kbhit() and getch() inside the game loop on all non-Sinclair targets, and with that problem keyboard control would not have been working, but it did work.
P.S. All other kbhit() targets support ANSI so there I include conio.h, but the Alphatronic target doesn't. Maybe this makes some difference.
P.P.S. In my test program you should add msleep(1000) before the second loop, because on some systems (e.g. Aquarius) the first x keypress would immediately end the second loop as well.
P.S. All other kbhit() targets support ANSI so there I include conio.h, but the Alphatronic target doesn't. Maybe this makes some difference.
P.P.S. In my test program you should add msleep(1000) before the second loop, because on some systems (e.g. Aquarius) the first x keypress would immediately end the second loop as well.
I think I fixed this issue in this change https://github.com/z88dk/z88dk/commit/3 ... 4cc4197db5 - it certainly worked on the Alphatronic. It's in the current nightly.
Most of the other targets you're using don't use in_Inkey() for kbhit() so weren't affected - it's only the new ones where I'm bypassing the firmware that had this problem.
Most of the other targets you're using don't use in_Inkey() for kbhit() so weren't affected - it's only the new ones where I'm bypassing the firmware that had this problem.
There is still one problem: could you please investigate why the 8 key is not working?
I haven't checked all keys, but among those used in my game all work except for 8.
Here is my updated kbhittest.c program.
I haven't checked all keys, but among those used in my game all work except for 8.
Here is my updated kbhittest.c program.
Code: Select all
// Compile with
// zcc +zx81 -startup=2 -o kbhittest_ZX81 -create-app kbhittest.c
// zcc +vg5k -lm -o kbhittest_vg5000 -create-app kbhittest.c
// zcc +aquarius -lm -o kbhittest_aquarius -create-app kbhittest.c
// zcc +alphatro -o kbhittest_alphatronic -create-app kbhittest.c
// zcc +z9001 -lgfx9001 -o kbhittest_z9001 -create-app kbhittest.c
#include <stdio.h>
void main()
{
char c;
int exitLoop;
printf("%c",12); // clear the screen
printf("\nkbhit() test\n");
printf("\n\nfirst loop\npress n / 5 / 8, or x to exit loop\n\n");
exitLoop=0;
do
{
if(kbhit())
{
c = getch();
if (c=='n' || c=='N') printf("\nkey n pressed");
if (c=='5') printf("\nkey 5 pressed");
if (c=='8') printf("\nkey 8 pressed");
if (c=='x' || c=='X') exitLoop=1;
}
}
while(exitLoop==0);
msleep(1000); // Wait one second so that you don't press x also for the second loop
printf("\n\nsecond loop\n\n");
exitLoop=0;
do
{
printf("\npress n / 5 / 8, or x to exit loop");
if(kbhit())
{
c = getch();
if (c=='n' || c=='N') printf("\nkey n pressed");
if (c=='5') printf("\nkey 5 pressed");
if (c=='8') printf("\nkey 8 pressed");
if (c=='x' || c=='X') exitLoop=1;
}
}
while(exitLoop==0);
printf("\n\ndone.");
fgetc_cons();
printf("%c",12); // clear the screen
return;
}
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
you all probably read this other post, but I think it's useful to leave a link here
https://z88dk.org/forum/viewtopic.php?p=21058#p21058
https://z88dk.org/forum/viewtopic.php?p=21058#p21058
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Could you please have a look at this? Attached is my grtest.c program and a batch file that creates both the 80x72 and 160x72 Alphatronic file.
With 80x72 it looks good:
With 160x72 it looks like this:
You do not have the required permissions to view the files attached to this post.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
I've been scratching my head about this one, but then I looked at the top of this thread.
It looks like I never got it working, though WIDTH 80 in BASIC does work. So I guess I'll need to go digging a bit more.
Edit: Aha, I've got it, I need to drive the CRTC directly...
It looks like I never got it working, though WIDTH 80 in BASIC does work. So I guess I'll need to go digging a bit more.
Edit: Aha, I've got it, I need to drive the CRTC directly...
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
I've pushed a change to support switching to 80 column mode:
It turns out the IO bit marked "80 column mode" doesn't actually do anything and the HD46505 needs to be poked manually to switch between widths.
It turns out the IO bit marked "80 column mode" doesn't actually do anything and the HD46505 needs to be poked manually to switch between widths.
You do not have the required permissions to view the files attached to this post.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Very good, thank you! That makes Deepspace work on the Alphatronic. And the mono sprites perform very well.
Is there a way to get rid of the blinking cursor? You can see it in the 160x72 grtest in the top left corner.
Is there a way to get rid of the blinking cursor? You can see it in the 160x72 grtest in the top left corner.
You do not have the required permissions to view the files attached to this post.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Of course there is, consider it done.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Thank you.
One more thing (hopefully the last issue, then it should be perfect): I have discovered a bug in the draw() function in 160x72, that's the reason why the fuel bar doesn't show up in Deepspace. Drawb() seems to be working correctly.
Here is my Megatoll graphics test in 80x72 (with " || defined(__ALPHATRO__) " removed in line 20), this is what it should look like:
And here is the result in 160x72, all horizontal lines and a few diagonal ones are missing:
One more thing (hopefully the last issue, then it should be perfect): I have discovered a bug in the draw() function in 160x72, that's the reason why the fuel bar doesn't show up in Deepspace. Drawb() seems to be working correctly.
Here is my Megatoll graphics test in 80x72 (with " || defined(__ALPHATRO__) " removed in line 20), this is what it should look like:
And here is the result in 160x72, all horizontal lines and a few diagonal ones are missing:
You do not have the required permissions to view the files attached to this post.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Thanks for the report, I fixed this one up a couple of days ago - my usual favourite issue of not changing the resolution that a few of the functions check against.
Re: (classic) New target: Triumph Adler/Royal Alphatronic PC
Thanks, it's all fine now. I have now released the Alpahtronic version of Deepspace.
In addition to the ROM file, I have also included a CP/M disk image, Stefano has recently added the Alphatronic subtype.
In addition to the ROM file, I have also included a CP/M disk image, Stefano has recently added the Alphatronic subtype.