Here it is: https://sourceforge.net/projects/euphor ... Novalight/
I took a quick look and actually Novalight doesn't do much: loading the tape header in page 2 (this is what ROM 1.1 does), and if ROM 1.0 is detected, copy the right bytes where they are supposed to be in page 0 for ROM 1.0. Then call the ROM code to end the loading and execute the program.
This is splitted in different "banks", so here is the code (if I'm not mistaken, haven't worked on it for more than a year now).
I think there's a trick as $02B1 is probably added to the header by Novalight, and set to zero (to save a few bytes LDA / STA, as Novalight won't check for errors and will leave $02B1 to zero).
Code: Select all
// Loading the header:
0103 2 A0 20 LDY #$20 Header is 32 bytes long (292-2B1). No RLE or dictionary bytes in header.
0105j 6 20 52 01 JSR $0152 Read a byte // this is a special novalight byte format
0108 5 99 91 02 STA 0291,Y Save header in memory + name + set error flag $02B1 to zero
010B 2 88 DEY Decrease Y *** at the end, A and Y = 0 ***
010C 2/3 D0 F7 BNE -9 Not finished: loop
// Once the program is loaded: adapt to ROM 1.0 if needed, and launch program:
018E 2 78 SEI Disable interrupts while finishing the program
018F 4 AE 02 C0 LDX $C002 Read EA or EC, respectively in ROM 1.0 or 1.1
0192 2 E8 INX Add 2 to get EC/EE, MSB of the initial IRQ to restore
0193 2 E8 INX (we need to do this as there is no location in ROM that contains
0194 2 8A TXA EC/EE in ROM 1.0/1.1; this saves room anyway)
0195 4 AE 40 FD LDX $FD40 Read 00 or 1C, respectively in ROM 1.0 or 1.1
0198 5 9D 2A 02 STA $022A,X Restore initial IRQ, $22A for ROM 1.0, $246 for ROM 1.1 ($246=$22A+$1C)
019B 4 AD CC E3 LDA $E3CC Read 03 or 22, respectively in ROM 1.0 or 1.1; LSB of the IRQ to restore
019E 5 9D 29 02 STA $0229,X Restore initial IRQ, $229 for ROM 1.0, $246 for ROM 1.1 ($246=$22A+$1C)
01A1 2 8A TXA Put X into A so we can check which ROM we are using.
01A2 2 F0 06 BEQ +6 If A=0 then we're on ROM 1.0, so jump to LDA $021F
01A4 20 3D E9 JSR $E93D ROM 1.1, restore VIA
01A7 4C D6 E8 JMP $E8D6 ROM 1.1, launch program in ROM 1.1 (set 02B1 flag to 0 before!)
01AA AD 1F 02 LDA $021F Check if HIRES mode activatied
01AD D0 03 BNE +3 If HIRES, don't clear the status line
01AF 20 63 E5 JSR $E563 ROM 1.0, clear status line
01B2 20 07 E7 JSR $E807 ROM 1.0, restore VIA (without status line clear)
01B5 A2 05 LDX #$05 Copy 6 bytes of the header in 5E-64
01B7 BD A9 02 LDA $02A9,X so it matches the ROM 1.0 addresses
01BA 95 5F STA $5F,X used to launch the program once loaded
01BC CA DEX (start/end addresses, AUTO mode and data type)
01BD 10 F8 BPL -8
01BF 4C C0 E7 JMP E7C0 ROM 1.0, launch program