Page 1 of 1

Oricutron Jasmin auto-boot not working

Posted: Tue Jul 15, 2014 9:37 pm
by christian
I'm working with Linux and now that Oricutron can use a keymap, I tested it to replace DosBox+Euphoric.

A new behavior was added between v1.0 and 1.1: jasmin auto-boot but unfortunately it does not work as expected.
With oric-1, the "Ready" prompt is replaced by "Printer error" and with atmos some commands end with "Syntax error" (NEW, RUN, ...)

After some tests and thanks to the memory change breakpoint and the CPU_TRACE option, I think the issue is calcpc and calcop aren't updated before the ay_ticktock function returns to the caller (frameloop_overclock or frameloop_normal).

So here is a patch proposal (tested):

Code: Select all

--- 8912.c	(révision 617)
+++ 8912.c	(copie de travail)
@@ -514,6 +514,8 @@
             ay->oric->cpu.write( &ay->oric->cpu, 0x3fb, 1 ); // ROMDIS
             setromon( ay->oric );
             m6502_reset( &ay->oric->cpu );
+            ay->oric->cpu.calcpc = ay->oric->cpu.pc;
+            ay->oric->cpu.calcop = ay->oric->cpu.read( &ay->oric->cpu, ay->oric->cpu.calcpc );
             via_init( &ay->oric->via, ay->oric, VIA_MAIN );
             ay->oric->auto_jasmin_reset = SDL_FALSE;
           }
@@ -526,6 +528,8 @@
             ay->oric->cpu.write( &ay->oric->cpu, 0x3fb, 1 ); // ROMDIS
             setromon( ay->oric );
             m6502_reset( &ay->oric->cpu );
+            ay->oric->cpu.calcpc = ay->oric->cpu.pc;
+            ay->oric->cpu.calcop = ay->oric->cpu.read( &ay->oric->cpu, ay->oric->cpu.calcpc );
             via_init( &ay->oric->via, ay->oric, VIA_MAIN );
             ay->oric->auto_jasmin_reset = SDL_FALSE;
           }

Hope this can help.

Personaly, I think the jasmin auto boot could be an option to keep the real Oric+Jasmin behavior.

Anyway, oricutron is a very useful tool.

Re: Oricutron Jasmin auto-boot not working

Posted: Tue Jul 15, 2014 10:52 pm
by Chema
Hi Christian.

I am sure Xeron reads these threads, but I think it would be much better if you open a bug report in Oricutron's page:
https://code.google.com/p/oriculator/issues/list

Just in case...

And thanks to everybody supporting and helping Xeron (and Xeron himself, of course) for this fantastic emulator! I use it for development and it works like a charm :)

Re: Oricutron Jasmin auto-boot not working

Posted: Wed Jul 16, 2014 8:19 am
by iss
Nice fix! I can confirm that above patch allows Oricutron to load Jasmin images.
( i.e. under Linux this works: $ ./oricutron -m 1 -k j -d disks/ftdos.dsk )
I'll wait day or two, if nobody commits the patch, I'll do it :)

Re: Oricutron Jasmin auto-boot not working

Posted: Wed Jul 16, 2014 9:34 am
by Godzil
Hum, I'm not sure if it's a good idea.. The jasmin boot button does not do a cold reset but a warm reset, it may rely on some BASIC stuff initialized, and directly jumping to the jasmin boot may cause problem at some point.

Have you intensively test your patch?

Re: Oricutron Jasmin auto-boot not working

Posted: Wed Jul 16, 2014 5:34 pm
by Xeron
Thanks very much for your patch! Awesome work tracking it down.

The separation of calculating cycles from actually performing the 6502 instruction does complicate things immensely, but greatly improves the cycle accuracy of the emulation.

I have done a slightly different change, which also recalculates the number of cycles for the instruction, but the fix is all down to your work!

BTW, if you are interested in commit access to the code, just send me a PM with the email address you use with google services.

Re: Oricutron Jasmin auto-boot not working

Posted: Wed Jul 16, 2014 5:36 pm
by Xeron
Godzil wrote:Hum, I'm not sure if it's a good idea.. The jasmin boot button does not do a cold reset but a warm reset, it may rely on some BASIC stuff initialized, and directly jumping to the jasmin boot may cause problem at some point.

Have you intensively test your patch?
The code in question does the correct boot for Jasmin, and RAM does not get cleared.