1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
| #include "ti83plus.inc" .org $9d93 .db t2ByteTok, tAsmCmp
#define dwait in a,($10) \ rla \ jr c,$-3
start: bcall(_delres) di
dwait ld a, 1 out ($10), a
dwait ld a, 5 out ($10), a dwait ld a, $20 out ($10), a dwait ld a, $80 out ($10), a
im 2 ld a, $8B ld i, a ld hl, $8B00 ld (hl), $8A ld de, $8B01 ld bc, $FF ldir ld hl, intRoutine ld de, $8A8A ld bc, intRoutine_End - intRoutine ldir
ld a, %00001000 out ($03), a
ld a, $44 out ($30), a ld a, 3 out ($31), a ld a, 1 out ($32), a ei
loop: ld a, $FE out ($01), a ld hl, (soundNum) ;do something nop nop in a, ($01) bit 0, a jr z, keyDownPress bit 3, a jr z, keyUpPress ld a, $FD out ($01), a nop nop nop ;how much delay are you supposed to have? nop nop nop nop in a, ($01) bit 6, a jr z, keyClearPress jr loop
keyDownPress: inc hl ;counterintuitive. I know. ld (soundNum), hl jr loop
keyUpPress: dec hl ld (soundNum), hl jr loop
keyClearPress: di xor a out ($31), a out ($30), a im 1 ld a, %00001011 out ($03), a ei ret ;bye bye intSound: ld a, $44 out ($30), a ld a, 3 out ($31), a ld a, 1 out ($32), a call fillScreen push bc push hl .db $21 ;ld hl,** soundStore: .dw $0100 dec h jr nz, intSound_ret .db $01 ;ld bc,** soundNum: .dw $1600 add hl, bc .db $3E ;ld a,* intSound_aSave: .db $00 xor %00000011 ld (intSound_aSave), a out ($00), a intSound_ret: ld (soundStore), hl pop hl pop bc pop af ei ret
intRoutine: push af ;int handling ;jump if port 30 interrupt jp intSound intRoutine_End:
fillScreen: push af push hl ld hl, fillScreen_rowCount inc (hl) ld a, $C0 cp (hl) jr nz, fillScreen_Draw ld a, $80 ld (hl), a out ($11), a dwait fillScreen_Draw ld a, r cpl rlca ld r, a out ($11), a pop hl pop af ret fillScreen_rowCount: .db 80
|