EgonOlsen71 / basicv2

A Commodore (CBM) BASIC V2 interpreter/compiler written in Java
https://egonolsen71.github.io/basicv2/
The Unlicense
85 stars 15 forks source link

Peek/Poke listener #3

Closed nietoperz809 closed 7 years ago

nietoperz809 commented 7 years ago

Hi, I would like to have peek/poke listeners. That enables others (like me) to develop plugins that mimic the hardware of real CBM machines.

EgonOlsen71 commented 7 years ago

There was a poke listener already (defined by the MemoryListener interface). I've added peek listener now as well. Hope this helps.

nietoperz809 commented 7 years ago

Thanx, Egon. I will probably plug in the popular ReSID sound system. https://en.wikipedia.org/wiki/ReSID ... which is also available in pure Java.

nietoperz809 commented 7 years ago

I now have ReSID up and running. The following BASIC:

0 POKE54296,15+32 :REM FILTERS: +16=LOW-PASS, +32=BAND-PASS, +64=HIGH-PASS 20 FORV=1TO3:PRINT:PRINT"VOICE";V:FORL=54272TO54295:POKEL,0:NEXT 30 ONVGOSUB80,90,100:POKEHF,15:POKELF,35:POKEHP,8:POKELP,0:POKEA,9:POKES,128 40 POKEW,65:POKE54295,2^(V-1)+128:FORP=0TO1 50 FORF=0TO2047STEP9:GOSUB70:NEXT:FORF=2047TO0STEP-9:GOSUB70:NEXT:NEXT:NEXT 60 FORL=54272TO54296:POKEL,0:NEXT:END 70 PRINTF;"{LEFT} {UP}":POKE54294,F/8:POKE54293,FAND7:RETURN 80 W=54276:A=54277:S=54278:HF=54273:LF=54272:HP=54275:LP=54274:RETURN 90 W=54283:A=54284:S=54285:HF=54280:LF=54279:HP=54282:LP=54281:RETURN 100 W=54290:A=54291:S=54292:HF=54287:LF=54286:HP=54289:LP=54288:RETURN

... makes a strange sound ... 💃

EgonOlsen71 commented 7 years ago

Nifty!