; My VIS 40 Project: 1-pixel video. ; Spencer Wohlers ; May 9, 2008 .nolist #include "ti83plus.inc" #define ProgStart $9D95 .list .org ProgStart - 2 .db t2ByteTok, tAsmCmp ; Title screen goes here. b_call(_ClrLCDFull) ; clear LCD b_call(_HomeUp) ; resets to (0,0) ld hl, introtext1 ; load address b_call(_PutS) ; prints string of text b_call(_NewLine) ; spawns a new line ld hl, introtext2 b_call(_PutS) b_call(_NewLine) b_call(_NewLine) ld hl, introtext3 b_call(_PutS) ; Wait a few seconds b_call(_GetKey) ; waits for any key to be pressed b_call(_RunIndicOff) ; turns off top-left animation. b_call(_ClrLCDFull) b_call(_HomeUp) ; loop construct ld hl, (ProgStart - 1) ; read RAM, starting with program ; read data from memory readMem: inc hl ld a, (hl) ld (currentbyte), a push hl ; we want to increment this value... ; write data to screen call dispByte ; end loop construct b_call(_GetCSC) ; get scan code. does not wait for input. pop hl ; ... so we preserve it from destruction. cp skClear ; 'a' gets result of compare jr z, cleanup ; if zero, clear was pressed. return. jp readMem ; otherwise, move back to loop. ; Fin. cleanup: b_call(_ClrScrnFull) ; clear everything, including text shadow b_call(_HomeUp) ret dispByte: ld a, (comparebyte) ; comparebyte is the bit mask for and ld b, a ; it can't be loaded into 'b' directly ld a, (currentbyte) and b ; ignores all bits but the set bit. and a ; if a is zero, 'z' flag is set. jp nz, fillScreen jp z, clearScreen ; if the bit is zero, clear the LCD GrBufCopy: b_call(_GrBufCpy) ; copy PlotSScreen to LCD and display ld a, (comparebyte) ; load the bitmask srl a ; shift the bit over ret c ; when done, move to next byte ld (comparebyte), a ; put it back. jp dispByte fillScreen: ld hl, PlotSScreen ld bc, 767 ld de, PlotSScreen+1 ld (hl), $FF ldir ; copies hl to de, dec bc, inc hl, inc de ld a, $D3 ; after bc hits zero, send linkport data out (0), a jp GrBufCopy clearScreen: ld hl, PlotSScreen ld de, PlotSScreen+1 ld (hl), $00 ld bc, 767 ldir ld a, $D0 out (0), a jp GrBufCopy introtext1: .db "VIS 40",0 introtext2: .db "1-Pixel Project",0 introtext3: .db "Spencer Wohlers",0 currentbyte: .db $00 comparebyte: .db %10000000 .end .end