Jump to content
IGNORED

Can you fit a whole game onto a QR code?


Rev

Recommended Posts

Reminds me of the Nintendo e-Reader, an accessory for the original Game Boy Advance from 2002.  13 of the original NES games were released on a pack of five cards apiece, each card having one or two "Dot Codes" that you swiped through an infrared scanner.

 

I thought it was cool back in the day to have a 32K game encapsulated into nine or ten scan codes, which I could then play on a handheld system.  That was still a novelty at the time before the GP32 came onto the scene.  Too bad the e-Reader was short-lived because Nintendo decided to push production of the Game Boy Advance SP.

  • Like 2
Link to comment
Share on other sites

We could make it a challenge - make a playable game within 2048 bytes (1 kilodecles). Possibly IntyBASIC users will have a drawback compared to hand coded assembly, but I'm not entirely sure that it is much more bloated. Perhaps knowledge of EXEC would be beneficial.

Edited by carlsson
  • Like 1
Link to comment
Share on other sites

8 minutes ago, carlsson said:

We could make it a challenge - make a playable game within 2048 bytes (1 kilodecles). Possibly IntyBASIC users will have a drawback compared to hand coded assembly, but I'm not entirely sure that it is much more bloated. Perhaps knowledge of EXEC would be beneficial.

That sounds like fun.  By any chance, have you read the @nanochess Boot Sector Games books?  Those games are limited to half a kilobyte!  A 2K challenge would just be generous by comparison.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, mr_me said:

According to the video, 2.9 KB is the capacity of the largest QR code.  So the earliest 2600 cartridges would fit but no Intellivision cartridges, maybe Biplanes would fit.

But 2.9 KB is just 1.45 Decles … so perhaps not even that.

Link to comment
Share on other sites

I know about the Boot Sector games, but then again Intellivision != IBM PC for good and bad. I know that with X86 code you can pack your code a lot even compared to 6502 or Z80. For many years there was a legendary Tetris implementation in 256 bytes I think.

 

Actually the three demo games included with the compiler generate binaries of 2136, 3078 and 3078 bytes each. The slalom game I made many years ago which I thought was trivial yields 4932 bytes with a title screen, so perhaps it is harder than I first thought. Putting a screen of custom graphics seems to take less space than actual game logic.

  • Like 1
Link to comment
Share on other sites

1 hour ago, carlsson said:

I know about the Boot Sector games, but then again Intellivision != IBM PC for good and bad. I know that with X86 code you can pack your code a lot even compared to 6502 or Z80. For many years there was a legendary Tetris implementation in 256 bytes I think.

 

Actually the three demo games included with the compiler generate binaries of 2136, 3078 and 3078 bytes each. The slalom game I made many years ago which I thought was trivial yields 4932 bytes with a title screen, so perhaps it is harder than I first thought. Putting a screen of custom graphics seems to take less space than actual game logic.

IntyBASIC is constantly accessing memory, which can add up.  For instance, every variable access translates into a “direct mode” move instruction, which takes two Decles each — and that’s before performing any operations on it.  Sometimes the same variable is accessed multiple times within the same expression.

 

A complex expression with multiple variables may require many such instructions.

 

Even simple things like FOR loops require the control variable to be read from memory, incremented, then written back to memory, all using direct mode move instructions.  Conversely, in an assembly language program, you would try to implement your control variables using a CPU register to make it leaner.

 

Most statements in IntyBASIC are rather fast, short, and efficient; but I’ve noticed that the reliance on accessing memory all the time adds to the bulk of the code, in size and performance cost.

 

Then, there is the notion that IntyBASIC encourages higher-level logic, which in turn translates into more potentially complex lower-level operations.

 

Still, I know there are some very good reasons for this, and IntyBASIC remains a very viable alternative to pure assembly language programs.

 

   dZ.

Edited by DZ-Jay
  • Like 2
Link to comment
Share on other sites

This is my first, very crude attempt. The BIN file currently is 1872 bytes so within 1 kilodecles. I would hesitate to call it a game as you can't die and it is quite rough, in particular plotting the goal which is a sprite due to me being lazy and I think calculating which background character you hit would cost more memory. Also I opted to not use any custom graphics to save as much space as possible. I'm not sure if #BACKTAB takes less space than PRINT.

 

Never mind I called it "racer", it most definitely isn't one right now...

racer.bas racer.rom

  • Like 3
Link to comment
Share on other sites

4 hours ago, mr_me said:

According to the video, 2.9 KB is the capacity of the largest QR code.  So the earliest 2600 cartridges would fit but no Intellivision cartridges, maybe Biplanes would fit.

With only 2.9KB available, that unfortunately means this masterpiece won't fit:

 

Today's magic phrase is "Beginnergers hurt"

 

Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...