An SMC ROM update is needed. I had trouble doing this on my H/W #108, but MooingLemur helped me out!! If you have a DevBoard, some feedback on if others are also having trouble would be good too (something about the bootloader might be there, but some fuse values may be incorrect on ATtiny? should try to confirm before Kevin prints the next batch!)
Some System ROM updates are also needed for the BASIC command support, and KERNAL support. This will probably become standard in the next "R45" System ROM update. For now, it is this update to R44:
https://github.com/X16Community/x16-rom ... 6079048038
Here is some BASIC code on using it (which also includes an example of how to do some "inline machine code" in BASIC-- it's an optional/alternative way to access the mouse wheel; a more typical way is to just use the MB and MWHEEL BASIC keywords that are added).
HOWEVER... The "scale" or range of mouse wheel values differs between the asm and BASIC. See below for example.
NOTE: I only tried using the Perixx mouse that came with the X16 DevBoards (same brand as the keyboards)
Code: Select all
10 W=$2000:WT=W
20 READ A:REM READ THE NEXT DATA VALUE (AT END OF LISTING)
30 IF A=-1 THEN GOTO 70
40 POKE WT,A
50 WT=WT+1
55 GOTO 20
60 ZZ=0:REM 0 FOR ASM SYS, 1 FOR BASIC MWHEEL
70 MOUSE 1
80 CLS:MWACC=0:A=49:REM SET TO DEFAULT TO ASM MODE
90 GOTO 237
130 IF ZZ=0 GOTO 160:REM GOTO ASM MODE
140 GOTO 190:REM GOTO BASIC MODE
160 SYS W:REM INVOKE MACHINE CODE. RTS TO GET BACK
170 A=PEEK($0780)
180 GOTO 200
190 A=MWHEEL
200 MWACC=MWACC+A:REM JUST MW ACCUMULATOR (NOT REALLY USEFUL)
210 IF A=0 AND MB=0 GOTO 230:REM ONLY PRINT WHEN NEW STATE
220 PRINT MWACC;:PRINT MB;:PRINT A
230 GET A$:A=ASC(A$)
235 IF A = 0 GOTO 260
236 IF A=27 THEN END:REM ESCAPE TO EXIT
237 PRINT "SWITCH MODE [";
240 IF A=49 THEN ZZ=0:PRINT"ASM]":GOTO 260:REM PRESS 1 FOR ASM
250 IF A=50 THEN ZZ=1:PRINT"BASIC]":REM PRESS 2 FOR BASIC MWHEEL
260 GOTO 130
1000 DATA $A2,$22 :REM LDX #$22
1010 DATA $20,$6B,$FF:REM JSR $FF6B
1020 DATA $8E,$80,$07:REM STX $0780
1030 DATA $60 :REM RTS
1040 DATA -1 :REM END OF LINE
Here is an example of the output. When running the BASIC sample, press #1 for the "assembler" version, press #2 for the BASIC version.
In the ASM call, SLOW MOUSE WHEEL UP will be value 255. The faster you scroll, the lower from 255 it will go (lowest I got was a value of about 251). SLOW MOUSE WHEEL DOWN will be value 1, and the faster you scroll (down) the higher from 1 it will go (highest value I got was about 7).
In the BASIC call, using MWHEEL: negative values are SCROLL UP. So -1 is a slow UP scroll, then faster scrolling "decreases" from there (I only got up to about -3 or -4). Positive values are SCROLL DOWN, starting at 1. Faster scrolling down increases that value (I only got up to value 4 or 6).
BASIC variable MB is updated to also recognize the mouse wheel itself as a button click.