| |
oziphantom
Registered: Oct 2014 Posts: 490 |
Packer vs Code VM vs Code Generator
Has anybody experimented with/know of code VMs or Generators.
Just thinking to get code size down they might perform better than exomiser et al.
I know of Sweet16 by Woz any others? |
|
... 80 posts hidden. Click here to view all posts.... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Oh, and i thought you were about to implement some kind of script interpreter for a domain-specific language of your own devising.
To be honest, i don't think the code generation you have in mind for that scroll routine will get you very far, and the compression ratio seems to be above 50%. The standard approach for that is to have a template with some placeholders for values and addresses, which you will modify and copy many times to create a flat unrolled copy/render routine.
Quoting oziphantomWhere the game would be unpacked with exomiser, then the code packer would parse the code bytes to spit out the expanded code, then the game would be run.
But it could all work out worse in the end. Curious to know what people already had/have tried and failed etc. If you check the source that comes with Artefacts you'll see that an approach that worked good for me was to split up the 6502 instruction stream into two separate streams, one for op-codes, one for the arguments. This along with code tailored with that in mind (you'd do LDA #$00 : LDX #$00 rather than LDA #$00 : TAX) gave me quite a plus on exomizer's compression ratio (plus i used Ninja's size-optimized exo decompressor). There are other techniques involved, such as packing function tables (sine curves etc.) lossily using polynomials and the good old code generation. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Krill, you cut off the first part of the definition: "In computing, a virtual machine (VM) is an emulation of a given computer system"
Jackie's code generator doesnt emulate anything. Its a data set on how to generate code. How to add up and scale vectors to calculate vertices is not a computer system's emulation we should agree I think... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Oh, and about exomizer... For a 4K, you'd probably get better results with ALZ64 which is a 6502-optimised LZMA variant. It's very slow, but not too slow for 4Ks. (I still need to check wether Artefacts is shorter using ALZ64 rather than exo.) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
oziphantom: I'd just collect often used routines into subs, and jsr. it depends how tight you want and how much time you have. if both are a lot then what you suggest could work. |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: Krill, you cut off the first part of the definition: "In computing, a virtual machine (VM) is an emulation of a given computer system"
Jackie's code generator doesnt emulate anything. Its a data set on how to generate code. How to add up and scale vectors to calculate vertices is not a computer system's emulation we should agree I think...
If it's turing complete I'd argue it's a crude VM, albeit running fixed code to generate the data set. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
What tlr said, but i think Turing completeness isn't necessary. You could build a VM for a stack machine (with exactly one stack) and it'd still be a VM. :) |
| |
mankeli
Registered: Oct 2010 Posts: 146 |
I believe the correct term would be automaton. :)
Automata Theory
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
"For stack machines in automata theory, see pushdown automaton." - Both are correct, "PDA" is just less ambiguous without the context (which is clear here). :) |
| |
TWW
Registered: Jul 2009 Posts: 545 |
You guys need to get laid... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting TWWYou guys need to get laid... How extraordinarily creative, smart and funny, yet dignified and mature. Surely, "TWW" is short for "The Witty Wisecracker"? I applaud you, good sir!
|
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - Next |