17 lines
451 B
Text
17 lines
451 B
Text
// Load a PPM file
|
|
// @10 = filename
|
|
// On return:
|
|
// #10 points to buffer containing pixel data,
|
|
// #11 = width, #12 = height.
|
|
|
|
:LOAD_PPM:
|
|
File_Open(@10)
|
|
BOF
|
|
Search("|X", ADVANCE) // skip "P6"
|
|
#11 = Num_Eval(ADVANCE) // #11 = width
|
|
Match("|X", ADVANCE) // skip separator
|
|
#12 = Num_Eval(ADVANCE) // #12 = height
|
|
Match("|X", ADVANCE)
|
|
Search("|X", ADVANCE) // skip maxval (assume 255)
|
|
Del_Block(0,CP) // remove the header
|
|
Return
|