> SRAMLoad  Demo FNsr_load() function : (+ ctrl% 31,data% 255:X%=ctrl%:Y%=X%256 2: < F *ROMS P "Filename: "fn$ Z "SRAM Bank: "bank% d result%=sr_load(fn$, bank%) n"Result: ";result% x  : : : ! FNsr_load(filename$, bank%) ! --------------------------- / Reads file filename$ into SRAM bank bank% ' Sets ROMTABLE entry after loading $ Requires: X%,Y%=>control block & data%=>256-byte buffer  Returns: 0: Ok 6 144: Not running on 6502 I/O processor # 214: File not found : %ݤsr_load(fn$,bank%):=sr_file() : "! FNsr_save(filename$, bank%) ,! --------------------------- 65 Writes file filename$ from SROM/SRAM bank bank% @$ Requires: X%,Y%=>control block J& data%=>256-byte buffer T Returns: 0: Ok ^6 144: Not running on 6502 I/O processor h' 192: Couldn't save file r: |%ݤsr_save(fn$,bank%):=sr_file() : ݤsr_file(LD%) B <&FFFF: ?&FFF7=&6C: ?&FFFB<128 =144: Not I/O processor - addr%,chn%:sr_wr=sr_wr:sr_wr=0:sr_asm -LD%:chn%=(fn$):chn%=0:=214: Not found 2LD%:chn%=(fn$):chn%=0:=192: Couldn't save LD%:ROMTABLE?bank%=0 :!&70=addr%+&8000 2LD%:gbpb(3,chn%,data%,256,0):A%=bank%:sr_wr 3LD%:A%=bank%:sr_rd:gbpb(1,chn%,data%,256,0) ,addr%=addr%+256:LD%:#chn%:addr%=&4000 4addr%>&3FFF:LD%:#chn%=6:ROMTABLE?bank%=#chn% #chn%:chn%=0:=0: Ok :  sr_asm +ROMTABLE=&2A1:?&FFB2=&40:ROMTABLE=&2A0 && mc% 39: P=0 1:P%=mc%:[OPT P*2 0.sr_rd:CLC:EQUB &24 :;.sr_wr:SEC:TAX:LDA &F4:PHA:PHP:JSR SelectROM:LDY #0:PLP D*.loop:BCC read:LDA data%,Y:STA (&70),Y N6.read:LDA (&70),Y:STA data%,Y:INY:BNE loop:PLA:TAX X(.SelectROM:STX &F6:STX &F4:JMP &FFB9 b ]:: l: vTgbpb(A%,chn%,addr%,num%,ptr%):?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:&FFD1: :