(classic) New target; Agon Light

Discussion about other targets
Post Reply
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

(classic) New target; Agon Light

Post by dom »

I've just merged support for our first ez80 target, the Agon Light.

This is a cheap-ish board with an 18Mhz ez80 coupled with an ESP32 running FabGL for VGA and keyboard support. The default firmware is based on BBC BASIC and as a result there's a MOS which handles the hardware which makes supporting it a bit easier than most new targets.

I'm still working on adding more features, but since it's already usable (though undoubtedly buggy) I figure it's worth an announcement!

Wiki page is here: https://github.com/z88dk/z88dk/wiki/Pla ... -AgonLight with a link to an emulator that can be used for testing.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: (classic) New target; Agon Light

Post by stefano »

Congratulations! I think we all hoped to see the whole IOT on that CPU when it was launched :)
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

This target has had a few tweaks over the past week or so:

- accelerated line drawing, circle drawing
- <time.h> is now available with a proper RTC
- argc, argv are now handled for main
- programs now exit cleanly

The last two mean that it's possible to write MOS extensions (copy the .bin file to mos folder) which can run from the command line.

Paulo has also updated z80asm so it can assemble ez80 mnemonics in both ADL=0 and ADL=1 modes and to go alongside that z88dk-dis now supports the ez80 in both ADL modes.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

With the latest release 0.4.0 of the emulator, a Windows-compiled binary is available for download.

The z88dk-created .bin files look good, almost everything seems to be working fine.

Only c_plot() and c_point() do not work yet, please take a look with my plottest.c program.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

And now they should - the c_plot code was being omitted completely because of a check for the screen resolution was off by one.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

Thanks, now c_plot() and c_point() are fine.

Next issue: named colours are a bit off.

AgonLight_NamedColoursTest.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

I've not added any mapping for the pens - for a few reasons:

- The number of pens varies by mode
- The VDP is meant to palette based (so can be changed)
- At the time the emulator didn't support changing the palette

If the emulator now supports changing the palette I can add a function to switch the pens to appropriate colours - I have to admit I've been distracted by yet another feature so I've not been keeping track of what's going on in Agon world.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

I've checked and the emulator doesn't support palette changing so I've added in colour mapping for mode 2 only.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

Thank you, the default colours in Mode 2 are perfect now, and in the other modes they are good.

In modes other than 2, "Lightcyan" doesn't really match the current yellow colour. But I assume this was chosen because that yellow colour wasn't mapped yet.
NamedColoursTest_AgonLight_Mode1_512x384.jpg
P.S. A new version of the Agon Light emulator is out, and it now allows disabling the debug output by starting it like this:
agon-light-emulator --log-level off
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

Oo, that is a terrible lightblue,brown and lightcyan- I know I'm bad with colours, but that's way off.

If you don't mind, could you take a look at the current mappings: https://github.com/z88dk/z88dk/blob/mas ... colour.asm and then the actual palette: https://gist.github.com/astralaster/33a ... df37afbd19 and suggest some corrections?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

Here is a quick Excel hack with a macro-generated preview of the 16 Agon Light colours, and in the last column I have assigned the named colours that IMHO should make sense.

P.S. What might be confusing to z88dk newcomers is that the "light" colour always stands for the "darker" colour, despite its name. But I agree that e.g. "RED" should be 255,0,0.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

Thank you so much, they work very nicely in both 16 and 64 colour modes.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

Thanks, the named colours are fine now.

Here is another problem, I fear this will be tough. I have let an Agon Light owner test a WIP version of Deepspace on the real machine. Here is a still from the video that he sent me, there are two problems:

1. A diagonal line appears on the game screen, going from top-left to bottom-right.

2. When moving a mono sprite by first xor-ing it on the new position and then on the old position, the old sprite does not get properly deleted, causing it to leave a trail behind.

The problem is that these issues can only be reproduced on the real hardware, while in the current version of the emulator everything looks good.

P.S. Ignore the cropped screen, this is only his monitor having trouble with VGA input.
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

Somewhat unusually I’ve actually got the hardware! I’m also having monitor problems - most modes are cut off in some way on the screen I’m using but it’s cranky with regular intel boxes so I’m not too worried.

So, there’s a chance we can track this one down. I’m AFK for a few days, so won’t be able to try it out immediately but can you ask regarding MOS and VDP versions?
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

dom wrote: Fri Jul 21, 2023 9:12 pm but can you ask regarding MOS and VDP versions?
He was using MOS and VDP 1.03, same as in the 0.5.0 emulator version.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

Okay, I've reproduced this on VDP 1.04RC1 and it's caused by the fuel bar.

However, it only seems to occur the first time the screen is drawn after the game is loaded and we can also see the fuel bar not decreasing during that first life. Subsequent games/lives seem to draw it correctly.

Drawing a line plots a pixel at x0,y0 then draws to x1,y1 - after a bit of experimenting it looks like plotting a pixel doesn't set the graphics cursor location in the VDP so it's left at 0,0. In the emulator, plotting does update the graphics cursor. I've pushed an update to forcibly update the graphics cursor so the next nightly should fix this issue.

The fact that the onboard VDP is different code to the emulated VDP is also made evident by the "snail trail" in the emulator of the ship which doesn't exist on the actual hardware.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Re: (classic) New target; Agon Light

Post by RobertK »

My tester has confirmed that the diagonal line is gone now, thanks.
The snail trail is still present on his 1.03 Agon Light. He will update it to 1.04 once it has been released (he does not want to mess around with the RCs).
dom wrote: Sat Jul 29, 2023 1:16 pm The fact that the onboard VDP is different code to the emulated VDP is also made evident by the "snail trail" in the emulator of the ship which doesn't exist on the actual hardware.
That confuses me, because I thought it was the other way round: in the 1.03 emulator, everything looks good, while on the 1.03 machine, the snail trail is there.
So, if I understand it correctly, there is no more snail trail on the real machine running VDP 1.04RC1?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

RobertK wrote: Thu Aug 17, 2023 8:49 pmThat confuses me, because I thought it was the other way round: in the 1.03 emulator, everything looks good, while on the 1.03 machine, the snail trail is there.
So, if I understand it correctly, there is no more snail trail on the real machine running VDP 1.04RC1?
Correct, I get a snail trial on the emulator, but not on the real hardware.
theflynn49
New member
Posts: 2
Joined: Thu Aug 10, 2023 2:16 pm

Re: (classic) New target; Agon Light

Post by theflynn49 »

Hello.
Maybe not appropriate here, but just FYI I just released a small color-text-game for the Agon light using z88dk +agon : github.com/theflynn49/fsudoku
I didn't use much of the library though. The compiler works like a charm, as a casual developer I am very pleased with it.
The only complaint I have is the file I/O, I couldn't make fseek working properly, but it could be my fault I don't know yet.
I can't wait to get an ADL=1 generated binary by it.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target; Agon Light

Post by dom »

If I remember lseek() does some nasty stuff looking into the internal (but public) FATfs file structure. I think absolute seeks should work.

So it might be a MOS version issue.
theflynn49
New member
Posts: 2
Joined: Thu Aug 10, 2023 2:16 pm

Re: (classic) New target; Agon Light

Post by theflynn49 »

dom wrote: Mon Sep 25, 2023 7:39 pm If I remember lseek() does some nasty stuff looking into the internal (but public) FATfs file structure. I think absolute seeks should work.

So it might be a MOS version issue.
Thank you for your quick answer. TBH, the MOS/VDP of the Agon Light is not stable yet, and I feel we need to wait for it to stabilize before blaming the compiler for anything. I'll make a small fread/ftell/fread/fseek/freread using both the z88dk library and the direct MOS file access and try to debug my stuff first before raising an issue about it. No hurry here.

Thank you again for this nice compiler, I like it very much.
snake
New member
Posts: 2
Joined: Thu Jan 18, 2024 12:34 am

Re: (classic) New target; Agon Light

Post by snake »

is there an ADL=1 (24 bit mode) switch for zcc?
Post Reply