Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3395

programming • Re: Routines to scan ROMFS catalog

$
0
0
These are great, and I like the attention to making a demonstration program.

I hesitate to comment, but doing arithmetic on the index rules out use with a compressed ROM, the very time you have to extract on the Beeb. Better but slower to let the ROM make its own way to the next block:

Code:

  110DEFFNrfs_info(idx%):LOCALG%,H%:IFidx%=0:A%=FNrfs_init(0)ELSE!&F4=?&F4OR(idx%AND-256)150A%=X%!12AND&FFFF:X%!21=X%!21+A%:IFA%FORG%=1TOA%+2:H%=FNrfs_rd:NEXT155UNTILX%?14>127:X%!10=X%!21:X%!14=&33:X%!18=!&F4:=$(X%+25)
Greg
Yes, I was wondering about that. I did all my testing with normal "slow" RFS ROMs and "fast" RFS ROMs. I made a mental note to track down a compressed RFS builder to make some test cases.

IF A% FOR G%=1 TO A%+2:H%=FNrfs_rd:NEXT
can be optimised to
IF A% FOR G%=1 TO A%+2:A%=FNrfs_rd:NEXT

as the FOR/NEXT termination value is only evaluated when setting up the FOR. I've just realised I could optimise the idx%=0 test as well by swapping the THEN/ELSE and dropping the '=0'.
IF idx%:!&F4=?&F4 OR (idx%AND-256) ELSE A%=FNrfs_init(0) ;)

I'm also wrapping my mind around making a Tube-agnostic version, it would need to use OSWORD 5/6 to get to &F5/&F6/&F7 in the I/O processor. I also want to check functionality with a file spanning past the end of a ROM into another ROM. I'm fairly certain it works, but I haven't built test code to confirm.

Statistics: Posted by jgharston — Tue May 20, 2025 1:46 am



Viewing all articles
Browse latest Browse all 3395

Trending Articles