0 Members and 2 Guests are viewing this topic.
;Test condition;Rickrollers of tomorrow.#include "ti83plus.inc".org $9D93.db $BB,$6D;Character mappings:; o m n i m a g a; $C7 $6D $C4 $D7 $6D $BB $67 $BB ld hl,0 ld (currow),hl ld hl,RightString bcall(_PutS) ld a,'w' bcall(_PutMap) ld c,0 ;counter for the scrolling textMainLoop: bcall(_getcsc) or a jr nz,Exiter ld hl,0 ld (currow),hl call ASubroutine; push bc; ld bc,0; dec bc; ld a,b; or c; jr nz,$-3; pop bc jr MainLoopExiter: bcall(_ClrLCDFull) ld hl,0 ld (currow),hl retASubroutine: ;writes the text out onto the screen;curRow=y curCol=x ld b,8 ;loop counter. Drawing down like that. ld e,cSubLoop: ld hl,PositionTable ld d,0 add hl,de ld a,(hl) push af or a jr z,$+3 dec a ld (curCol),a ;position from left edge pop af push de ld hl,TheOmnimaga ld e,a add hl,de pop de or a jr z,$+9 ;skip over leading space write if on left edge push af ld a,' ' bcall(_PutC) pop af push af ld a,(hl) bcall(_PutC) inc hl ld a,(hl) bcall(_PutC) pop af cp 6 jr z,$+7 ;skip over trailing space write if at middle of screen ld a,' ' bcall(_PutC) ld hl,curRow inc (hl) inc e djnz SubLoop inc c ld a,c cp 12 ret nz ld c,0 ret RightString:.db "11 The ".db " 22 ".db " 33 Rick ".db " 44 Roller",$27,"s".db " 55 ".db " 66 Of ".db " 77 ".db " 88 Tomorro",0TheOmnimaga:.db $C7,$6D,$C4,$D7,$6D,$BB,$67,$BB ;04PositionTable: ;13 width, pad 8 more..db 0,1,2,3,4,5,6,5,4,3,2,1,0,1,2,3,4,5,6,5,4,3.end.end
Here's my version. It's lightning-fast and it's only 291 bytes on-calc.Spoiler For Coder's Comments: I so horribly cheated. It's an ASM program being called by a BASIC program. Here's the code for the ASM program:Code: [Select];Test condition;Rickrollers of tomorrow.#include "ti83plus.inc".org $9D93.db $BB,$6D;Character mappings:; o m n i m a g a; $C7 $6D $C4 $D7 $6D $BB $67 $BB ld hl,0 ld (currow),hl ld hl,RightString bcall(_PutS) ld a,'w' bcall(_PutMap) ld c,0 ;counter for the scrolling textMainLoop: bcall(_getcsc) or a jr nz,Exiter ld hl,0 ld (currow),hl call ASubroutine; push bc; ld bc,0; dec bc; ld a,b; or c; jr nz,$-3; pop bc jr MainLoopExiter: bcall(_ClrLCDFull) ld hl,0 ld (currow),hl retASubroutine: ;writes the text out onto the screen;curRow=y curCol=x ld b,8 ;loop counter. Drawing down like that. ld e,cSubLoop: ld hl,PositionTable ld d,0 add hl,de ld a,(hl) push af or a jr z,$+3 dec a ld (curCol),a ;position from left edge pop af push de ld hl,TheOmnimaga ld e,a add hl,de pop de or a jr z,$+9 ;skip over leading space write if on left edge push af ld a,' ' bcall(_PutC) pop af push af ld a,(hl) bcall(_PutC) inc hl ld a,(hl) bcall(_PutC) pop af cp 6 jr z,$+7 ;skip over trailing space write if at middle of screen ld a,' ' bcall(_PutC) ld hl,curRow inc (hl) inc e djnz SubLoop inc c ld a,c cp 12 ret nz ld c,0 ret RightString:.db "11 The ".db " 22 ".db " 33 Rick ".db " 44 Roller",$27,"s".db " 55 ".db " 66 Of ".db " 77 ".db " 88 Tomorro",0TheOmnimaga:.db $C7,$6D,$C4,$D7,$6D,$BB,$67,$BB ;04PositionTable: ;13 width, pad 8 more..db 0,1,2,3,4,5,6,5,4,3,2,1,0,1,2,3,4,5,6,5,4,3.end.end
:ClrHome:1→A:1→B:For(θ,1,8:Disp ":End:While 1:"σmπimαgα→Str1:Output(8,A,sub(Str1,A,2:Output(1,9," :Output(3,9," :Output(4,9," :Output(6,9," :Output(8,9," :Disp ":Output(1,9,"The:Output(3,9,"Rick:Output(4,9,"Roller's:Output(6,9,"of:Output(8,9,"Tomorrow:A+B→A:If A=7 or A=1:-B→B:EndGenerated by SourceCoder, © 2005-2010 Cemetech
ClrHome1→AAns→BFor(Θ,1,7Disp "EndRepeat 0Output(8,A,sub("σmπimαgα",A,2For(C,1,8Output(C,9,"________EndDisp "Output(1,9,"TheOutput(3,9,"RickOutput(4,9,"Roller'sOutput(6,9,"OfOutput(8,9,"TomorrowA+B→AIf A=7 or A=1-B→BEnd