Login
Back to forumSee the full topicGo to last reply

Posted By

Mad
on 2017-01-17
17:44:07
 Re: BASIC Bitmap loading (KERNAL Subroutine) in the Encyclopedia

Ups ok.. Csabo already had it working with another tool.. I just compiled some basic lines with MMS load function and a simple IRQ player for knaecketracker through basic data lines. BasicExample with Knaecketracker in the ".zip" is all you need to get it run with knaecketracker.

The whole basic prg looks like this.. But perhaps it's somewhen time to learn machine language aswell, basic is really limiting especially on such a machine.

30 FI$="SNG1AT7000"
4000 REM -= Loader routine by MAD/MMS/gerliczer/George =-
4010 SYS DEC("F2CE"):REM restore system interrupt vectors, for restart
4020 KA=DEC("7000"):REM Knaecketracker Tune Address
4030 SA=DEC("07f2"):SX=SA+1:SY=SX+1:SR=SY+1
4040 TB=DEC("0333"):DRV=8
4050 REM put the file name into FI$ eg.FI$="examplepic" BEFORE calling the Subroutine
4060 FI=LEN(FI$)
4070 FORI=1TOFI:POKETB-1+I,ASC(MID$(FI$,I,1)):NEXT: REM filename to TB store
4080 POKESA,0:POKESX,DRV:POKESY,0:SYSDEC("ffba"): REM DRIVE 8
4090 POKESA,FI:POKESX,TBAND255:POKESY,TB/256:SYSDEC("ffbd"): REM filename KERNAL
4100 POKESA,0:POKESX,KAAND255:POKESY,KA/256:SYSDEC("ffd5"): REM Load from $1800
4200 REM -= Knaecketracker Player by Mad =-
4210 CA=DEC("7FE0"):REM Rasterinterruptstub address
4220 DATA 120,169,68,141,18,3,169,68,141,19,3,88,96,32,68,68,32,68,68,76,66,206
4230 FOR I=0 TO 21:READ V:POKE CA+I,V:NEXT I
4240 POKE CA+2,(CA+13) AND 255:POKE CA+7,(CA+13)/256
4250 POKE CA+14,(KA+3) AND 255:POKE CA+15,(KA+3)/256:REM player tick
4260 POKE CA+17,(KA+6) AND 255:POKE CA+18,(KA+6)/256:REM player output
4270 SYS KA:REM initialize player
4280 SYS CA:REM install new rasterinterrupt

It uses the vertical blank interrupt ($0312/$0313) it seems the rasterinterrupt is used several times a frame in basic.
And don't forget the SYS DEC("F2CE") if you call the loading or the player two times (for instance at another "run").

Remove the "MAD" in the loaderroutine I don't know anything about what it does :)

And yes, that's all off topic it was just because of the silly idea to load songs also with this routine by MMS :)



Back to top


Copyright © Plus/4 World Team, 2001-2024