prng: .byte 0,0,0,0 rngtest: lda #<prng ldx #>prng jsr rnd_seed ldy #$80 sty $61 lp1:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define POLYMASK_32 0xb4bcd35c | |
#define POLYMASK_31 0x7a5bc2e3 | |
#include <stdio.h> | |
#include <stdint.h> | |
uint32_t lfsr32; | |
uint32_t lfsr31; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* snapshot.c - Implementation of machine snapshot files. | |
* | |
* Written by | |
* Ettore Perazzoli <[email protected]> | |
* Marco van den Heuvel <[email protected]> | |
* | |
* This file is part of VICE, the Versatile Commodore Emulator. | |
* See README for copyright notice. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sprite0_widthmask: | |
// bitwidth 0 | |
.byte 0, 0, 0, 0 | |
// bitwidth 1 | |
.byte %11111111, 0, 0, 0 | |
// bitwidth 2 | |
.byte %11111111, %11111111, 0, 0 | |
// bitwidth 3 | |
.byte %11111111, %11111111, %11111111, 0 | |
// bitwidth 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lda colora+0 | |
sta $d020 | |
lda colora+1 | |
sta $d021 | |
lda #$00 | |
sta $d020 | |
sta $d021 | |
// multicolor gfx mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------- | |
.macro drawboard(screen,colorbuf) { | |
.const tsetbits = $62 | |
.const tbits = $63 | |
.const col = $64 | |
lda #BLACK | |
sta col | |
lda #WHITE | |
sta col+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "container" for Kcal input forms (sets up formik with validation for the kcal fields). | |
export const KcalForm = ({ initialValues, onSubmit, render }) => { | |
return ( | |
<Formik | |
initialValues={initialValues} | |
validateOnChange | |
validate={values => { | |
let errors = {} | |
if (values.amount === '') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderSaveCancel = () => { | |
return ( | |
<Fragment> | |
<button onClick={this.handleSave} | |
style={{width: '50%'}} | |
disabled={!this.state.amount} | |
className='button is-primary'> | |
Save | |
</button> | |
<button onClick={this.handleCancel} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Diary action creators | |
export class Diary { | |
static RECEIVE = 'DIARY_RECEIVE' | |
static actions = { | |
fetchByDate: (date) => { | |
return function (dispatch, getState) { | |
const urls = [ | |
'/api/food', | |
'/api/recipe', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE only up to 5 bit numbers are supported | |
function makeFormula (bits) { | |
const superscripts = ['\u2070', '\u00B9', '\u00B2', '\u00B3', '\u2074'] | |
const nbits = bits.length | |
const parts = bits.map((b,idx) => { | |
const boffs = nbits - idx - 1 | |
return b.toString() + '\u22C5' + '2' + superscripts[boffs] | |
}) | |
return parts.join(' + ') | |
} |