Jump to content
Thomas Jentzsch

QR Code generation

Recommended Posts

29x29 with 6-scanlines per block works perfectly on my small CRT (with heavy rounding), and there's plenty of blanking around the QR code.

 

qr_29x29_test.thumb.jpg.6578adda114ce353f5b75ba57becb43a.jpg

 

I can even QR scan this picture being displayed on my computer monitor.

 

7800 binary attached, as well as the QR code test image in binary.

 

qrtest.a78

qrtest-binary-data.txt

 

Share this post


Link to post
Share on other sites

And that's with minimal error correction (1st and 2nd pixel below top left eye = 11). 

  • Like 1

Share this post


Link to post
Share on other sites
52 minutes ago, Thomas Jentzsch said:

That would probably be simpler, but people are much more used to QR codes. And many today's smartphone have QR-code readers ready out of the box.

The image produced is readable by a QR app on a phone, here a link to the high-score-cafe, but looks like you have a solution.

 

image.thumb.png.fcec3f73b86521ab2120b0d978cd0d5c.png

  • Like 2

Share this post


Link to post
Share on other sites
27 minutes ago, Wrathchild said:

but looks like you have a solution.

Not at all, just on somewhere the way to it. :) 

 

Edit: After looking into the Datamatrix code provided, I might change my mind. The code generation seems more compact. And we have tested code.

Edited by Thomas Jentzsch

Share this post


Link to post
Share on other sites
12 minutes ago, RevEng said:

I'm not arguing against it, but it looks like it uses self-modifying code.

I think at the sacrifice of not wanting to use any zeropage space, so could be reworked to use indirect lookups and variables instead.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, RevEng said:

29x29 with 6-scanlines

I am using 7 lines (was the most square I could get), with 6 lines the distortion looks minimal. Probably 29 x 29 should work fine.

 

37 minutes ago, Wrathchild said:

The image produced is readable by a QR app on a phone

This is indeed a Data Matrix, not a QR code. My phone supports it directly from the camera app, I don't now how compatible it is with most phones... This might be an alternative and is what they are generating dynamically, it does not even have to be square. I had no idea...

They do save to use one extra byte, since it is 24 x 24, but the border is static, making the dynamic part 22 x 22, and they are encoding 32 chars...

https://www.qrcode-tiger.com/data-matrix-code-vs-qr-code

 

  • Like 1

Share this post


Link to post
Share on other sites
35 minutes ago, Wrathchild said:

I think at the sacrifice of not wanting to use any zeropage space, so could be reworked to use indirect lookups and variables instead.

And it is not that much code which is affected, so that should be quite easy. The features of XASM are more of a problem when converting to DASM.

 

BTW: What does "scc:eor <301" do? I understand "scc", but the "eor" part makes no sense to me. Also, where does than magic number come from?

Share this post


Link to post
Share on other sites

I tried Data Matrix in my phone with the default camera app, unsuccessfully. I have no problems with the QR (including my "reduced" avatar at the side of the quick reply form).

 

I guess that any app from the store could read DM as well as QR.

 

  • Like 2

Share this post


Link to post
Share on other sites
49 minutes ago, Thomas Jentzsch said:

What does "scc:eor <301" do? I understand "scc", but the "eor" part makes no sense to me.

In code this comes out as, so I can only think 'by design'

image.png.8a47f4ef7a0df8e29cfd4b032df00a5f.png

 

But @fox is on AA so hopefully can explain that and the magic number?

Share this post


Link to post
Share on other sites
2 hours ago, vitoco said:

I tried Data Matrix in my phone with the default camera app, unsuccessfully. I have no problems with the QR (including my "reduced" avatar at the side of the quick reply form).

That's the problem I was afraid of. Also the iOS camera app seems to support QR code only.

Share this post


Link to post
Share on other sites
9 hours ago, RevEng said:

People use monospace fonts to embed QR codes in reddit posts, and those are nowhere near square.

Interesting, I'd like to see an example of this.  :D

9 hours ago, Thomas Jentzsch said:

Depends on the webserver, AFAIK (e.g. IIS is not case-sensitive). So maybe we can ignore case. But that's academic for now. First we have to solve more major problems. :) 

Case is important, Linux webservers are by default case sensitive.  The case of the domain name is not important, but any arguments passed beyond that are usually case sensitive and in general you will not get where you are wanting to go if you don't use the proper case for those arguments.  For instance, here's the URL to this thread:

 

 

If you change just one letter here (capitalize Forums), you'll get an error:

 

https://atariage.com/Forums/topic/319259-qr-code-generation/

1 hour ago, Thomas Jentzsch said:

That's the problem I was afraid of. Also the iOS camera app seems to support QR code only.

Yeah, I'd prefer to stick with QR code, since support for that is pretty universal these days.  I've seen those Data Matrix codes before, but generally not in a way intended for the general public to use. 

6 hours ago, RevEng said:

29x29 with 6-scanlines per block works perfectly on my small CRT (with heavy rounding), and there's plenty of blanking around the QR code.

 

qr_29x29_test.thumb.jpg.6578adda114ce353f5b75ba57becb43a.jpg

 

I can even QR scan this picture being displayed on my computer monitor.

I can scan the above image as well using the camera app in iOS.

 

 ..Al

  • Like 1

Share this post


Link to post
Share on other sites
27 minutes ago, Albert said:

Interesting, I'd like to see an example of this.  :D

 

I find you sometimes need to pull out a bit, so the lines between each ascii row are blurred.

 

Also some neat non-ascii, but non-standard QR codes...

 

 

 

...now I need to get out of r/qrcodes before I go any deeper down the rabbit hole.

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Albert said:

Case is important, Linux webservers are by default case sensitive.  The case of the domain name is not important, but any arguments passed beyond that are usually case sensitive and in general you will not get where you are wanting to go if you don't use the proper case for those arguments. 

Indeed. Although there are probably ways around this if need be. At the end of Penult I give a URL, but since my text is caps-only, I used a URL shortener that was case-insensitve. 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, RevEng said:

 

I find you sometimes need to pull out a bit, so the lines between each ascii row are blurred.

 

Also some neat non-ascii, but non-standard QR codes...

 

 

 

...now I need to get out of r/qrcodes before I go any deeper down the rabbit hole.

 

Wow, that's very cool.  The first two work fine using the iOS camera app, but the last one does not.  Probably would work better with a dedicated QR code reader app.  Thanks for digging those up.  Pretty interesting especially to see that first one work!!

 

 ..Al

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Albert said:

Case is important, Linux webservers are by default case sensitive.  The case of the domain name is not important,...

So here we can use upper case.

7 hours ago, Albert said:

...but any arguments passed beyond that are usually case sensitive and in general you will not get where you are wanting to go if you don't use the proper case for those arguments.

And the arguments are under our control. If we encode the data into alphanumeric we can decode it from alphanumeric too. Of course binary is more versatile, alphanumeric would save us a bit space for the domain name part (e.g. "AAGE.US/" would need 8*8 = 64 vs. 4*11 = 44 bits). But the difference is marginal and probably not worth the effort.

 

Anyway, for now I plan to stick with binary.

Share this post


Link to post
Share on other sites
4 hours ago, Albert said:

Wow, that's very cool.

Don't expect something even remotely similar from me. :) 

 

These kind of QR-code are all done with level H (30%) error correction. I currently plan for level M (15%) error correction. Maybe this allows for some limited freedom too.

Share this post


Link to post
Share on other sites
8 hours ago, Albert said:

I can scan the above image as well using the camera app in iOS.

I am currently wondering if I should switch from playfield to sprite graphics. The QR code would become much smaller, which will have advantage and disadvantages. Actually I found that I have to move away from my monitor when scanning the large QR codes.

 

"The Stacks" uses such a small 25x25 QR code (also with level M error correction) and it seems to work fine.

 

The main reason for wanting to switch is the much easier memory organization when using sprites. With playfield I have to work with very convoluted reflected and split data. Both require 78.x bytes of RAM, so there is not enough space left for a 2nd buffer. Converting the data stream from the QR code encoder into display data using the same RAM should be much easier for sprites.

Share this post


Link to post
Share on other sites

My thoughts on the matter so far:

 

The stacks QR code should not work well on CRTs. It should work fine in all other kind of monitors. I think it is worth a test on CRTs, my gut feeling might be wrong.

 

I updated my game to use 25% error correction QR and appears to be doing better.

 

The Circus Convoy people are really smart people. They probably know that data matrix is less compatible with phones, since they used QR codes on the static content. My guess is that they reached some kind of road block that the data matrix somehow solves for the dynamic ones.

 

It takes one celebrity to reach other. @ZeroPage Homebrewcan you ask them if they can disclose a little bit of information on the subject?

 

 

Share this post


Link to post
Share on other sites
3 hours ago, Octavio Pinho Bokel said:

The stacks QR code should not work well on CRTs.

Just because of the size? 

Share this post


Link to post
Share on other sites

A little math to show how short RAM for a version 2 (25x25), level M QR code is:  

  • max. message length: 28 bytes
  • ECC code length: 16 bytes
  • QR code: 25x25 bits = 78 bytes (forget the 1 remaining bit, that can be hard coded)

That's 122 bytes in total. We probably will have to at least partially overwrite the message and ECC code when converting both into QR code. With playfield graphics this would become even more complex as it already is.

 

Share this post


Link to post
Share on other sites
47 minutes ago, Thomas Jentzsch said:

But it is not displayed in the corners. :?

He means blurring on each pixel edge, not the screen edge.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...