Jump to content
Thomas Jentzsch

QR Code generation

Recommended Posts

17 hours ago, Albert said:

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

My phone can't read the Tesla QR code at all but was able to read the DOTA one. However, my phone's camera doesn't recognize anything and I had to install a dedicated barcode scanner app on my phone sometime ago. But I think the app is only able to read black and white colored codes which is why it can't read the Tesla one. It can tell there is something there as I see it locking onto the dots, but just keeps shifting around them.

 

Share this post


Link to post
Share on other sites

Thanks for posting, Darrell. 

 

"...the single hardest thing I have ever done an 8-bit microprocessor..." :) 

 

It's tough, that's for sure. But after solving the Reed-Solomon ECC it doesn't look too complicated. It is just ~80 bytes of code and a 16 bytes table. But there were quite a few iterations until I got there. And I still have to test and probably bug fix it.

 

What seems more challenging is placing the data bits. For a 21x21 QR code which Audacity Games uses it looks OK:

1280px-QR_Character_Placement.svg.png

But when you switch to 25x25 or larger, additional alignment patterns have to be added. And then the rectangular code modules suddenly become complex:

1280px-QR_Ver3_Codeword_Ordering.svg.png

That's the next challenge I am facing.

 

The biggest problem is, that I haven't found a way to test intermedia codes yet. And I found no app which checks QR codes and points out the bugs. This will make testing not easy.

Edited by Thomas Jentzsch
  • Like 2

Share this post


Link to post
Share on other sites

Voila! The first 25x25 QR code generator is working. The encoded message is hard coded (you can patch the ROM if you like), but the QR code is really generated on-the-fly. 

 

There are still a few to dos, e.g. there is NO RAM free and the mask pattern is fixed. But these are relatively simple problems.

 

Code and data currently require ~600 bytes, the code is generated in ~190,000 cycles.

 

BTW: With the left difficulty switch you can move the QR code up and down. This is meant for testing on CRT TVs.

 

QR Code Generator V0.1 (Thomas Jentzsch) (2021).bin

Edited by Thomas Jentzsch
  • Like 12

Share this post


Link to post
Share on other sites
1 minute ago, Thomas Jentzsch said:

Voila! The first 25x25 QR code generator is working. The encoded message is hard coded (you can patch the ROM if you like), but the QR code is really generated on-the-fly. 

Awesome!!  :)

Share this post


Link to post
Share on other sites

Apart from how Audacity Games utilized the codes, what kind of applications can these be used for? I had not realized how involved they are. I just assumed they were like a complex barcode.

Share this post


Link to post
Share on other sites
4 minutes ago, KevKelley said:

Apart from how Audacity Games utilized the codes, what kind of applications can these be used for? I had not realized how involved they are. I just assumed they were like a complex barcode.

The "QR Code" game. Goal is to remove pixels from the QR code and still have a valid code. That is, you need to balance zapping the error correcting pixels, or only enough of the original pixels such that the error correcting still works... and make a way for your hero to travel from one side to the other in "QR land". If you get it wrong, you get taken to a NSFW URL that gets you instantly dismissed from work - or worse.

  • Haha 2

Share this post


Link to post
Share on other sites
6 minutes ago, KevKelley said:

I had not realized how involved they are.

Decoding is even waaay more complex. :) 

Share this post


Link to post
Share on other sites
5 hours ago, KevKelley said:

Apart from how Audacity Games utilized the codes, what kind of applications can these be used for? I had not realized how involved they are. I just assumed they were like a complex barcode.

Some puzzles, maybe? Granted I don't imagine it would get much more complicated than inputting a code you get from scanning.

Given score submissions, I do have to wonder how you'd get around people scanning someone else's code. It looks like Circus Convoy is using the cartridge id as a way to verify this, but that's not a luxury most of us have access to.

 

Edit, just hit me that this could potentially used to hide information from another player in multiplayer games. Could open up some interesting avenues for design, I suppose.

Edited by bluswimmer
  • Like 1

Share this post


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

Some puzzles, maybe? Granted I don't imagine it would get much more complicated than inputting a code you get from scanning.

Given score submissions, I do have to wonder how you'd get around people scanning someone else's code. It looks like Circus Convoy is using the cartridge id as a way to verify this, but that's not a luxury most of us have access to.

 

Edit, just hit me that this could potentially used to hide information from another player in multiplayer games. Could open up some interesting avenues for design, I suppose.

I welcome any development for the Atari. I just wonder how this can be used in gaming. The Audacity application is very interesting but I was curious what else. It's like watching Demo videos and wondering how the hardware pushing demos could be used for games (or the new MovieCart).

 

I was wondering if QR Codes could somehow create weird hybrid games, kind of like the old Odyssey2 board game games. Or be used as a kind of off system addition, like if the game generates a code that can later be recalled.

Share this post


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

Given score submissions, I do have to wonder how you'd get around people scanning someone else's code.

You can always combine that with an account you have to be logged in. 

 

I think ideas how this might enhance game play are plenty. People can be very creative. E.g. this could become an online replacement for the SaveKey high score function which allows sharing emulator and console high scores. Of course a SaveKey is more convenient, but score submissions to online tournaments would become easier this way. 

 

2 hours ago, KevKelley said:

I was wondering if QR Codes could somehow create weird hybrid games, kind of like the old Odyssey2 board game games. Or be used as a kind of off system addition, like if the game generates a code that can later be recalled.

My thoughts exactly. Mixing an Atari 2600 game with web content or storing access passwords (one can encode quite a lot in ~20 bytes). 

Share this post


Link to post
Share on other sites

A litte update. I have now implemented all eight mask pattern (might not be required). At first glance it looked like that really complicated math would be required (e.g invert pixel if (x * y % 2 + x * y % 3) % 2 == 0). But I found some shortcuts, so only basic math required. :) 

 

Then I defined 16 short text messages. Together with the eight mask pattern, this allows for 128 combinations. A new QR code is generated when you press fire.

 

By overlapping input and output data, I have reduced RAM usage to 91 bytes. Code size increased to ~720 bytes, mainly due to the seven new mask pattern. The standard requires that the code should evaluate the result using all eight pattern and chose the best one. But I suppose for our needs we might get away with only one, fixed mask pattern and save some ROM.

 

BTW: Audacity Games only uses four mask pattern (the simpler ones :)) and iterates over them. So if one pattern should fail, the user can try with a different one. 

QR Code Generator V0.2 (Thomas Jentzsch) (2021).bin

  • Like 3

Share this post


Link to post
Share on other sites

Most impressive! Now all that's needed is some code to use the light gun as a QR code reader. :D

 

(I kid... I kid...)

  • Haha 1

Share this post


Link to post
Share on other sites
23 minutes ago, Karl G said:

Most impressive! Now all that's needed is some code to use the light gun as a QR code reader. :D

 

(I kid... I kid...)

I like this line of thinking. This makes me think of science fiction or military development, where years later we peons get to experience the grandeur of such technology in the form of games. Lol

Share this post


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

Most impressive! Now all that's needed is some code to use the light gun as a QR code reader. :D

Even if this would be technically possible, the code required goes way above the limits of the good old 6507:

 

Berlekamp-Massey, Chien search, Forney algorithm...

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...