ORIC SDCARD

This is the right place to discuss on how to implement hardware vsync, adding a VIA or AY chipset, puting multiple roms, or how to design a new flash expansion card.
User avatar
Symoon
Archivist
Posts: 2307
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: ORIC SDCARD

Post by Symoon »

Dbug wrote: Sun Mar 21, 2021 6:38 pm Do you have a link to the latest version?
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
PS: I know the code isn't respecting anyting standard ^^
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: ORIC SDCARD

Post by Dbug »

By loading the header, are we also talking of the 16 16 16 16 ... 24 synchro sequence? Or just the addresses, type/auto exec bytes, and possibly the filename?
User avatar
Symoon
Archivist
Posts: 2307
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: ORIC SDCARD

Post by Symoon »

Dbug wrote: Sun Mar 21, 2021 9:36 pm By loading the header, are we also talking of the 16 16 16 16 ... 24 synchro sequence? Or just the addresses, type/auto exec bytes, and possibly the filename?
Option 2!
The header starts after $24, the $16 / $24 sequence is never stored in RAM during the loading process.
BTW, I realize the whole sequence of restoring the interrupts comes from the way Novalight works, and is useless to standard loading
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: ORIC SDCARD

Post by Dbug »

Regarding IRQ, I noticed something weird in the ROM, when the RESET is called, the first thing the ROM does is to call CLI to restore IRQ, before even setting the value in $0244, so in the case where an IRQ triggers (let say "the machine was already running and we are just resetting it") it will immediately crash.

That normally does not happen because the VIA was not yet setup, but in my case I was simulating a reset avec initialization, and the IRQ vector was garbage, but the VIA was active, took me some time to find out what the heck happened :)
User avatar
kenneth
Squad Leader
Posts: 515
Joined: Fri Nov 26, 2010 9:11 pm
Location: France PdD
Contact:

Re: ORIC SDCARD

Post by kenneth »

There is an update about the Erebus UVprom memory, called Erebus II, created by Fred_72, it allows the use of "HC" SDcards (>2Gb).
https://forum.system-cfg.com/download/file.php?id=32269
Post Reply