{"author_link":"\/users\/cliffracerx","author_name":"CliffracerX","author_uid":"cliffracerx","comments":[],"epoch":1534612143,"event":"LD42","format":"md","ldjam_node_id":117597,"likes":1,"metadata":{"p_key":"121041","p_author":"CliffracerX","p_authorkey":"1000563","p_urlkey":"337076","p_title":"A paint program (made in Senbir)","p_cat":"LDJam ","p_event":"LD42","p_time":"1534612143","p_likes":"1","p_comments":"0","p_status":"WAYBACK","us_key":"1000563","us_name":"CliffracerX","us_username":"cliffracerx","event_start":"1533859200","event_key":"73","event_name":"LD 42"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD42","removed_author":false},"_superparent":97793,"_trust":4,"author":563,"body":"![SenbirPaint.gif](\/\/\/raw\/332\/z\/1a29b.gif)\nNot the MOST exciting thing to post about (everyone's used paint programs by now!), but it IS a paint program made for running on Senbir's Extended mode computer.\n\nFor those curious to give it a try in-game, the code:\n```\n\/\/==PAINT==\n\/\/WASD to navigate.  Spacebar toggles if you're painting or not.  Use E and Q to shift forwards and backwards through the list of colors, respectively.\n\/\/This version was made for EXTENDED MODE, with its 16x8 resolution, and 4-color capability.\n\/\/=REGISTER USAGE=\n\/\/REGISTER 00: BRUSH DOWN?\n\/\/REGISTER 01->2: KEY PRESS THIS TICK\n\/\/REGISTER 03: USED FOR IFJMPS\n\/\/REGISTER 04: BRUSH X\n\/\/REGISTER 05: BRUSH Y\n\/\/REGISTER 06: BACKGROUND COLOR REGISTER (USED IF BRUSH IS NOT DOWN)\n\/\/REGISTER 07: BRUSH COLOR REGISTER (USED IF BRUSH IS DOWN)\n\/\/REGISTER 08: TEMPORARY MODIFICATION REGISTER\n\/\/REGISTER 12: INT 16\n\/\/REGISTER 13: INT 8\n\/\/REGISTER 14: INT 4\n\/\/REGISTER 15: INT 1\nSET 15 3 00000001 \/\/Set register 15 to the integer 01.  Addr0.\nSET 14 3 00000100 \/\/Set register 14 to the integer 04.  Addr1.\nSET 13 3 00001000 \/\/Set register 13 to the integer 08.  Addr1.  Yes, I know, there's a duplicate.\nSET 12 3 00010000 \/\/Set register 12 to the integer 16.  Addr2.\nSET 6 0 00000000 \/\/Set register 6 to have the appropriate color.  Addr3.\nSET 7 0 01000000 \/\/Set register 7 to have the appropriate color - white.  Addr4.\nGETDATA 2 3 0 \/\/Get the last keyboard input.  Addr5.\nPMOV 1 2 0 31 0 0 \/\/Move the last keyboard input into register 2.  Addr6.\nIFJMP 0 15 1 \/\/If a key was pressed, jump to the input subroutine.  Addr7.\nJMP 2 3 \/\/Otherwise, do nothing.  Addr8.\nPMOV 9 2 0 31 0 0 \/\/Put the \"brush down\" variable in so IFJMP'll accept it.  Addr9.\nIFJMP 0 2 0 \/\/Jump to the background restore if the brush isn't down.  Addr10.\nJMP 0 2 \/\/Otherwise, jump past it.  Addr11.\nSETDATA 0 3 6 \/\/Wipe the old one.  Addr12.\nPMOV 4 7 28 31 6 1 \/\/Splice the last 4 bits of the X register (the actual x position) into the rendering register, offset +6 (<28>XXXX -> CCXXXX<26>).  Addr13.\nPMOV 5 7 29 31 9 1 \/\/Splice the last 3 bits of the Y register (the actual y position) into the rendering register, offset +9 (<29>YYY -> CCXXXXYYY<23>).  Addr14.\nPMOV 7 8 0 31 30 1 \/\/Addr15.\nGETDATA 0 3 8 \/\/Get the monitor data.  Addr16.\nMATH 1 6 5 \/\/Paste the color in. Addr17.\nJMP 0 1 \/\/Addr18.\nJMP 0 1 \/\/Addr19.\nSETDATA 0 3 7 \/\/Render the brush.  Addr20.\nJMP 2 16 \/\/Jump back to the start of the loop.  Addr21.\nSET 0 0 01011101 \/\/START OF INPUT SUBROUTINE.  Set Register 0 to the key ID for W.  Addr22.\nSET 0 1 11000000 \/\/Set Register 0 to the key ID for W.  Addr23.\nGETDATA 2 3 0 \/\/Check the W.  Addr24.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr25.\nIFJMP 0 34 1 \/\/If W IS pressed, jump to the appropriate memory position.  Addr26.\nSET 0 0 01011000 \/\/Set Register 0 to the key ID for A.  Addr27.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for A.  Addr28.\nGETDATA 2 3 0 \/\/Check the A.  Addr29.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr30.\nIFJMP 0 32 1 \/\/If A IS pressed, jump to the appropriate memory position.  Addr31.\nSET 0 0 01011100 \/\/Set Register 0 to the key ID for S.  Addr32.\nSET 0 1 11000000 \/\/Set Register 0 to the key ID for S.  Addr33.\nGETDATA 2 3 0 \/\/Check the S.  Addr34.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr35.\nIFJMP 0 30 1 \/\/If S IS pressed, jump to the appropriate memory position.  Addr36.\nSET 0 0 01011001 \/\/Set Register 0 to the key ID for D.  Addr37.\nSET 0 1 00000000 \/\/Set Register 0 to the key ID for D.  Addr38.\nGETDATA 2 3 0 \/\/Check the D.  Addr39.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr40.\nIFJMP 0 28 1 \/\/If D IS pressed, jump to the appropriate memory position.  Addr41.\nSET 0 0 01001000 \/\/Set Register 0 to the key ID for SPACEBAR.  Addr42.\nSET 0 1 00000000 \/\/Set Register 0 to the key ID for SPACEBAR.  Addr43.\nGETDATA 2 3 0 \/\/Check the SPACEBAR.  Addr44.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr45.\nIFJMP 0 26 1 \/\/If SPACEBAR IS pressed, jump to the appropriate memory position.  Addr46.\nSET 0 0 01011100 \/\/Set Register 0 to the key ID for Q.  Addr47.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for Q.  Addr48.\nGETDATA 2 3 0 \/\/Check the Q.  Addr49.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr50.\nIFJMP 0 28 1 \/\/If Q IS pressed, jump to the appropriate memory position.  Addr51.\nSET 0 0 01011001 \/\/Set Register 0 to the key ID for E.  Addr52.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for E.  Addr53.\nGETDATA 2 3 0 \/\/Check the E.  Addr54.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr55.\nIFJMP 0 33 1 \/\/If E IS pressed, jump to the appropriate memory position.  Addr56.\nSET 0 0 00000000 \/\/Unset 0.  Addr57.\nSET 0 1 00000000 \/\/Unset 0.  Addr58.\nJMP 2 50 \/\/Jump back to the render loop.  Addr59.\nMATH 15 5 1 \/\/W WAS PRESSED.  Increment Y down by one.  Addr60.\nMATH 13 5 4 \/\/Modulo Y just in case.  Addr61.\nJMP 2 5 \/\/Jump back to the render loop.  Addr62.\nMATH 15 4 1 \/\/A WAS PRESSED.  Increment X down by one.  Addr63.\nMATH 12 4 4 \/\/Modulo Y just in case.  Addr64.\nJMP 2 3 \/\/Jump back to the render loop.  Addr65.\nMATH 15 5 0 \/\/S WAS PRESSED.  Increment Y up by one.  Addr66.\nMATH 13 5 4 \/\/Modulo Y just in case.  Addr67.\nJMP 2 3 \/\/Jump back to the render loop.  Addr68.\nMATH 15 4 0 \/\/D WAS PRESSED.  Increment X up by one.  Addr69.\nMATH 12 4 4 \/\/Modulo Y just in case.  Addr70.\nJMP 2 3 \/\/Jump back to the render loop.  Addr71.\nMATH 9 2 5 \/\/Move the contents of Address 9 (the brush toggle) into 2 for IFJMP use.  Addr72.\nIFJMP 0 2 0 \/\/Is the brush up?  Addr73.\nJMP 0 3 \/\/Nope.  Addr74.\nSET 9 3 00000001 \/\/Turn the brush on.  Addr75.\nJMP 0 2 \/\/Skip past turning it off.  Addr76.\nSET 9 3 00000000 \/\/Turn the brush off.  Addr77.\nJMP 2 7 \/\/Jump back to the render loop.  Addr78.\nSET 8 0 00000000 \/\/Addr79.\nSET 8 1 00000000 \/\/Addr80.\nSET 8 2 00000000 \/\/Addr81.\nSET 8 3 00000000 \/\/Addr82.\nMATH 7 8 5 \/\/Splice the color in.  Addr83.\nPMOV 7 8 0 1 30 1 \/\/THING.  Addr84.\nMATH 15 8 1 \/\/Q WAS PRESSED.  Increment COL down by one.  Addr85.\nMATH 14 8 4 \/\/Modulo COL just in case.  Addr86.\nPMOV 8 7 28 31 30 0 \/\/Splice it back into the renderer.  Addr87.\nJMP 2 10 \/\/Jump back to the render loop.  Addr88.\nSET 8 0 00000000 \/\/Addr89.\nSET 8 1 00000000 \/\/Addr90.\nSET 8 2 00000000 \/\/Addr91.\nSET 8 3 00000000 \/\/Addr92.\nMATH 7 8 5 \/\/Splice the color in.  Addr93.\nPMOV 7 8 0 1 30 1 \/\/THING.  Addr94.\nMATH 15 8 0 \/\/E WAS PRESSED.  Increment COL up by one.  Addr95.\nMATH 14 8 4 \/\/Modulo COL just in case.  Addr96.\nPMOV 8 7 28 31 30 0 \/\/Splice it back into the renderer.  Addr97.\nJMP 2 10 \/\/Jump back to the render loop.  Addr98.\n```\n\nI also have a Custom preset & updated version that're better for pixel art-ing up in a thread on Itch.IO: https:\/\/itch.io\/t\/279217\/code-sharing-megathread\n\nIf you want to see what Senbir's VM is capable of without having to muck around in the code yourself, this is a good way to do it.\n\nYou can compile it straight to the computer's ROM once you've pasted it into the Assembler window.  Turn the computer on, activate the keyboard (look at it and press F), and then use WASD to move the paint cursor around, spacebar to toggle drawing, and Q\/E to cycle colors.","comments":0,"created":"2018-08-18T03:23:53Z","files":[],"files-timestamp":0,"id":117597,"love":1,"love-timestamp":"2018-08-19T00:38:41Z","meta":[],"modified":"2018-08-19T00:38:41Z","name":"A paint program (made in Senbir)","node-timestamp":"2018-08-18T17:09:03Z","parent":98716,"parents":[1,5,9,97793,98716],"path":"\/events\/ludum-dare\/42\/senbir\/a-paint-program-made-in-senbir","published":"2018-08-18T17:09:03Z","scope":"public","slug":"a-paint-program-made-in-senbir","subsubtype":"","subtype":"","type":"post","version":351862},"node_metadata":{"n_key":"117597","n_urlkey":"337076","n_parent":"98716","n_path":"\/events\/ludum-dare\/42\/senbir\/a-paint-program-made-in-senbir","n_slug":"a-paint-program-made-in-senbir","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"563","n_created":"1534562633","n_modified":"1534639121","n_version":"351862","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/42\/senbir\/a-paint-program-made-in-senbir","text":"![SenbirPaint.gif](\/\/\/raw\/332\/z\/1a29b.gif)\nNot the MOST exciting thing to post about (everyone's used paint programs by now!), but it IS a paint program made for running on Senbir's Extended mode computer.\n\nFor those curious to give it a try in-game, the code:\n```\n\/\/==PAINT==\n\/\/WASD to navigate.  Spacebar toggles if you're painting or not.  Use E and Q to shift forwards and backwards through the list of colors, respectively.\n\/\/This version was made for EXTENDED MODE, with its 16x8 resolution, and 4-color capability.\n\/\/=REGISTER USAGE=\n\/\/REGISTER 00: BRUSH DOWN?\n\/\/REGISTER 01->2: KEY PRESS THIS TICK\n\/\/REGISTER 03: USED FOR IFJMPS\n\/\/REGISTER 04: BRUSH X\n\/\/REGISTER 05: BRUSH Y\n\/\/REGISTER 06: BACKGROUND COLOR REGISTER (USED IF BRUSH IS NOT DOWN)\n\/\/REGISTER 07: BRUSH COLOR REGISTER (USED IF BRUSH IS DOWN)\n\/\/REGISTER 08: TEMPORARY MODIFICATION REGISTER\n\/\/REGISTER 12: INT 16\n\/\/REGISTER 13: INT 8\n\/\/REGISTER 14: INT 4\n\/\/REGISTER 15: INT 1\nSET 15 3 00000001 \/\/Set register 15 to the integer 01.  Addr0.\nSET 14 3 00000100 \/\/Set register 14 to the integer 04.  Addr1.\nSET 13 3 00001000 \/\/Set register 13 to the integer 08.  Addr1.  Yes, I know, there's a duplicate.\nSET 12 3 00010000 \/\/Set register 12 to the integer 16.  Addr2.\nSET 6 0 00000000 \/\/Set register 6 to have the appropriate color.  Addr3.\nSET 7 0 01000000 \/\/Set register 7 to have the appropriate color - white.  Addr4.\nGETDATA 2 3 0 \/\/Get the last keyboard input.  Addr5.\nPMOV 1 2 0 31 0 0 \/\/Move the last keyboard input into register 2.  Addr6.\nIFJMP 0 15 1 \/\/If a key was pressed, jump to the input subroutine.  Addr7.\nJMP 2 3 \/\/Otherwise, do nothing.  Addr8.\nPMOV 9 2 0 31 0 0 \/\/Put the \"brush down\" variable in so IFJMP'll accept it.  Addr9.\nIFJMP 0 2 0 \/\/Jump to the background restore if the brush isn't down.  Addr10.\nJMP 0 2 \/\/Otherwise, jump past it.  Addr11.\nSETDATA 0 3 6 \/\/Wipe the old one.  Addr12.\nPMOV 4 7 28 31 6 1 \/\/Splice the last 4 bits of the X register (the actual x position) into the rendering register, offset +6 (<28>XXXX -> CCXXXX<26>).  Addr13.\nPMOV 5 7 29 31 9 1 \/\/Splice the last 3 bits of the Y register (the actual y position) into the rendering register, offset +9 (<29>YYY -> CCXXXXYYY<23>).  Addr14.\nPMOV 7 8 0 31 30 1 \/\/Addr15.\nGETDATA 0 3 8 \/\/Get the monitor data.  Addr16.\nMATH 1 6 5 \/\/Paste the color in. Addr17.\nJMP 0 1 \/\/Addr18.\nJMP 0 1 \/\/Addr19.\nSETDATA 0 3 7 \/\/Render the brush.  Addr20.\nJMP 2 16 \/\/Jump back to the start of the loop.  Addr21.\nSET 0 0 01011101 \/\/START OF INPUT SUBROUTINE.  Set Register 0 to the key ID for W.  Addr22.\nSET 0 1 11000000 \/\/Set Register 0 to the key ID for W.  Addr23.\nGETDATA 2 3 0 \/\/Check the W.  Addr24.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr25.\nIFJMP 0 34 1 \/\/If W IS pressed, jump to the appropriate memory position.  Addr26.\nSET 0 0 01011000 \/\/Set Register 0 to the key ID for A.  Addr27.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for A.  Addr28.\nGETDATA 2 3 0 \/\/Check the A.  Addr29.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr30.\nIFJMP 0 32 1 \/\/If A IS pressed, jump to the appropriate memory position.  Addr31.\nSET 0 0 01011100 \/\/Set Register 0 to the key ID for S.  Addr32.\nSET 0 1 11000000 \/\/Set Register 0 to the key ID for S.  Addr33.\nGETDATA 2 3 0 \/\/Check the S.  Addr34.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr35.\nIFJMP 0 30 1 \/\/If S IS pressed, jump to the appropriate memory position.  Addr36.\nSET 0 0 01011001 \/\/Set Register 0 to the key ID for D.  Addr37.\nSET 0 1 00000000 \/\/Set Register 0 to the key ID for D.  Addr38.\nGETDATA 2 3 0 \/\/Check the D.  Addr39.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr40.\nIFJMP 0 28 1 \/\/If D IS pressed, jump to the appropriate memory position.  Addr41.\nSET 0 0 01001000 \/\/Set Register 0 to the key ID for SPACEBAR.  Addr42.\nSET 0 1 00000000 \/\/Set Register 0 to the key ID for SPACEBAR.  Addr43.\nGETDATA 2 3 0 \/\/Check the SPACEBAR.  Addr44.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr45.\nIFJMP 0 26 1 \/\/If SPACEBAR IS pressed, jump to the appropriate memory position.  Addr46.\nSET 0 0 01011100 \/\/Set Register 0 to the key ID for Q.  Addr47.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for Q.  Addr48.\nGETDATA 2 3 0 \/\/Check the Q.  Addr49.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr50.\nIFJMP 0 28 1 \/\/If Q IS pressed, jump to the appropriate memory position.  Addr51.\nSET 0 0 01011001 \/\/Set Register 0 to the key ID for E.  Addr52.\nSET 0 1 01000000 \/\/Set Register 0 to the key ID for E.  Addr53.\nGETDATA 2 3 0 \/\/Check the E.  Addr54.\nMATH 1 2 5 \/\/Move the result of GetData in.  Addr55.\nIFJMP 0 33 1 \/\/If E IS pressed, jump to the appropriate memory position.  Addr56.\nSET 0 0 00000000 \/\/Unset 0.  Addr57.\nSET 0 1 00000000 \/\/Unset 0.  Addr58.\nJMP 2 50 \/\/Jump back to the render loop.  Addr59.\nMATH 15 5 1 \/\/W WAS PRESSED.  Increment Y down by one.  Addr60.\nMATH 13 5 4 \/\/Modulo Y just in case.  Addr61.\nJMP 2 5 \/\/Jump back to the render loop.  Addr62.\nMATH 15 4 1 \/\/A WAS PRESSED.  Increment X down by one.  Addr63.\nMATH 12 4 4 \/\/Modulo Y just in case.  Addr64.\nJMP 2 3 \/\/Jump back to the render loop.  Addr65.\nMATH 15 5 0 \/\/S WAS PRESSED.  Increment Y up by one.  Addr66.\nMATH 13 5 4 \/\/Modulo Y just in case.  Addr67.\nJMP 2 3 \/\/Jump back to the render loop.  Addr68.\nMATH 15 4 0 \/\/D WAS PRESSED.  Increment X up by one.  Addr69.\nMATH 12 4 4 \/\/Modulo Y just in case.  Addr70.\nJMP 2 3 \/\/Jump back to the render loop.  Addr71.\nMATH 9 2 5 \/\/Move the contents of Address 9 (the brush toggle) into 2 for IFJMP use.  Addr72.\nIFJMP 0 2 0 \/\/Is the brush up?  Addr73.\nJMP 0 3 \/\/Nope.  Addr74.\nSET 9 3 00000001 \/\/Turn the brush on.  Addr75.\nJMP 0 2 \/\/Skip past turning it off.  Addr76.\nSET 9 3 00000000 \/\/Turn the brush off.  Addr77.\nJMP 2 7 \/\/Jump back to the render loop.  Addr78.\nSET 8 0 00000000 \/\/Addr79.\nSET 8 1 00000000 \/\/Addr80.\nSET 8 2 00000000 \/\/Addr81.\nSET 8 3 00000000 \/\/Addr82.\nMATH 7 8 5 \/\/Splice the color in.  Addr83.\nPMOV 7 8 0 1 30 1 \/\/THING.  Addr84.\nMATH 15 8 1 \/\/Q WAS PRESSED.  Increment COL down by one.  Addr85.\nMATH 14 8 4 \/\/Modulo COL just in case.  Addr86.\nPMOV 8 7 28 31 30 0 \/\/Splice it back into the renderer.  Addr87.\nJMP 2 10 \/\/Jump back to the render loop.  Addr88.\nSET 8 0 00000000 \/\/Addr89.\nSET 8 1 00000000 \/\/Addr90.\nSET 8 2 00000000 \/\/Addr91.\nSET 8 3 00000000 \/\/Addr92.\nMATH 7 8 5 \/\/Splice the color in.  Addr93.\nPMOV 7 8 0 1 30 1 \/\/THING.  Addr94.\nMATH 15 8 0 \/\/E WAS PRESSED.  Increment COL up by one.  Addr95.\nMATH 14 8 4 \/\/Modulo COL just in case.  Addr96.\nPMOV 8 7 28 31 30 0 \/\/Splice it back into the renderer.  Addr97.\nJMP 2 10 \/\/Jump back to the render loop.  Addr98.\n```\n\nI also have a Custom preset & updated version that're better for pixel art-ing up in a thread on Itch.IO: https:\/\/itch.io\/t\/279217\/code-sharing-megathread\n\nIf you want to see what Senbir's VM is capable of without having to muck around in the code yourself, this is a good way to do it.\n\nYou can compile it straight to the computer's ROM once you've pasted it into the Assembler window.  Turn the computer on, activate the keyboard (look at it and press F), and then use WASD to move the paint cursor around, spacebar to toggle drawing, and Q\/E to cycle colors.","title":"A paint program (made in Senbir)","wayback_source":[]}