JOric

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: JOric

Post by Chema »

Nice! Quite a lot of advances! Congrats. It is exciting to see new emulators.

I hope you are enjoying Blake's 7. People spending time playing my games means all to me. Don't heaitate to post any question, comment, bug or suggestion.

Regarding Space 1999, can you be more specific? Does it hang in the demo ot in the actual game? If it is in the demo, you can skip it pressing ESC. If it is in the game, please tell me when. It could be when checking for a saved game... in any case it is strange. Could you check if 1337 boots correctly?
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Chema wrote: Thu Apr 19, 2018 10:11 pm I hope you are enjoying Blake's 7. People spending time playing my games means all to me. Don't heaitate to post any question, comment, bug or suggestion.
Will do. I assume you're an animated graphic adventure game fan as well. I'm about as big as they come. I spent a lot of the 90s reverse engineering the Sierra AGI adventure game system and writing specs on how it works. I've also written an AGI interpreter in C# (unfortunately currently in a private repo but will make it public one day). And I created one of the very first fan made AGI adventure game demos called The Ruby Cast. I'd very much like to attempt to create a game like Blake's 7 on the Oric as well. I played pretty much all of the Lucasfilm games through the 80s and early 90s. Maniac Mansion started it all. I'm sure we could do an Oric port.

A bit off topic for the Oric, but here's a short Lucasfilm tribute game I submitted for the js13kgames contest last year:
http://js13kgames.com/games/down-the-drain/index.html

I had big plans for it, but ran out of time. I always do with that contest. I'm always away on holiday then end up having only 2 weeks to come up with something. I enjoy it though. :)
Chema wrote: Thu Apr 19, 2018 10:11 pmRegarding Space 1999, can you be more specific? Does it hang in the demo ot in the actual game? If it is in the demo, you can skip it pressing ESC. If it is in the game, please tell me when. It could be when checking for a saved game... in any case it is strange. Could you check if 1337 boots correctly?
It hangs almost immediately. This is a screenshot of where it hangs:
joric_space_1999.png
joric_space_1999.png (8.02 KiB) Viewed 13182 times
In Oricutron, it moves on from that screen after about 4 seconds.

I'll check 1337 now and let you know how it goes.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: JOric

Post by Chema »

That is in the intro probably just when starting music. Strange. I wil take a look at the sources.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

dreamseal wrote: Thu Apr 19, 2018 10:34 pm I'll check 1337 now and let you know how it goes.
It appears that you're on to something. 1337 hangs as well. It doesn't get beyond this:
joric_1337.png
joric_1337.png (5.91 KiB) Viewed 13178 times
But in Oricutron, it moves on from that immediately. I'm going to step through the instructions to see what its doing.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

In 1337, it seems to be stuck here:

Code: Select all

0005531142:  PC=ee9d,A=02,X=00,Y=14,S=f6,P=--E---C,stack=[00,bf,eb,04,76,c9,11,ee,ce] 
EE9D:    PHA
0005531145:  PC=ee9e,A=02,X=00,Y=14,S=f5,P=--E---C,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EE9E:    ASL A
0005531147:  PC=ee9f,A=04,X=00,Y=14,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EE9F:    TAY
0005531149:  PC=eea0,A=04,X=00,Y=04,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA0:    SEI
0005531151:  PC=eea1,A=04,X=00,Y=04,S=f5,P=--E-I--,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA1:    LDA $0272,y
0005531155:  PC=eea4,A=14,X=00,Y=04,S=f5,P=--E-I--,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA4:    LDX $0273,y
0005531159:  PC=eea7,A=14,X=00,Y=04,S=f5,P=--E-IZ-,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA7:    CLI
0005531161:  PC=eea8,A=14,X=00,Y=04,S=f5,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA8:    TAY
0005531163:  PC=eea9,A=14,X=00,Y=14,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA9:    PLA
0005531167:  PC=eeaa,A=02,X=00,Y=14,S=f6,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce] 
EEAA:    RTS
0005531173:  PC=eecf,A=02,X=00,Y=14,S=f8,P=--E----,stack=[00,bf,eb,04,76,c9,11] 
EECF:    CPY #$00
0005531175:  PC=eed1,A=02,X=00,Y=14,S=f8,P=--E---C,stack=[00,bf,eb,04,76,c9,11] 
EED1:    BNE $eecc
0005531178:  PC=eecc,A=02,X=00,Y=14,S=f8,P=--E---C,stack=[00,bf,eb,04,76,c9,11] 
EECC:    JSR $ee9d
0005531184:  PC=ee9d,A=02,X=00,Y=14,S=f6,P=--E---C,stack=[00,bf,eb,04,76,c9,11,ee,ce] 
EE9D:    PHA
0005531187:  PC=ee9e,A=02,X=00,Y=14,S=f5,P=--E---C,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EE9E:    ASL A
0005531189:  PC=ee9f,A=04,X=00,Y=14,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EE9F:    TAY
0005531191:  PC=eea0,A=04,X=00,Y=04,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA0:    SEI
0005531193:  PC=eea1,A=04,X=00,Y=04,S=f5,P=--E-I--,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA1:    LDA $0272,y
0005531197:  PC=eea4,A=14,X=00,Y=04,S=f5,P=--E-I--,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA4:    LDX $0273,y
0005531201:  PC=eea7,A=14,X=00,Y=04,S=f5,P=--E-IZ-,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA7:    CLI
0005531203:  PC=eea8,A=14,X=00,Y=04,S=f5,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA8:    TAY
0005531205:  PC=eea9,A=14,X=00,Y=14,S=f5,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce,02] 
EEA9:    PLA
0005531209:  PC=eeaa,A=02,X=00,Y=14,S=f6,P=--E----,stack=[00,bf,eb,04,76,c9,11,ee,ce] 
EEAA:    RTS
I haven't yet spent any time looking over this code, but will do now. Looks like the BASIC ROM, so I'll take a look at the BASIC ROM disassembly and see if there are any useful comments.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

For Space 1999, it seems to be stuck here:

Code: Select all

0010817770:  PC=08a4,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08A4:    LDA $00a1
0010817774:  PC=08a7,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08A7:    STA $56
0010817777:  PC=08a9,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08A9:    LDA $56
0010817780:  PC=08ab,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AB:    STA $56
0010817783:  PC=08ad,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AD:    LDA #$00
0010817785:  PC=08af,A=00,X=00,Y=01,S=f2,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AF:    STA $57
0010817788:  PC=08b1,A=00,X=00,Y=01,S=f2,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B1:    LDA $56
0010817791:  PC=08b3,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B3:    ORA $57
0010817794:  PC=08b5,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B5:    BEQ $8ba
0010817796:  PC=08b7,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B7:    JMP $08a4
0010817799:  PC=08a4,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 

08A4:    LDA $00a1
0010817803:  PC=08a7,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08A7:    STA $56
0010817806:  PC=08a9,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08A9:    LDA $56
0010817809:  PC=08ab,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AB:    STA $56
0010817812:  PC=08ad,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AD:    LDA #$00
0010817814:  PC=08af,A=00,X=00,Y=01,S=f2,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08AF:    STA $57
0010817817:  PC=08b1,A=00,X=00,Y=01,S=f2,P=--E--Z-,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B1:    LDA $56
0010817820:  PC=08b3,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B3:    ORA $57
0010817823:  PC=08b5,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B5:    BEQ $8ba
0010817825:  PC=08b7,A=64,X=00,Y=01,S=f2,P=--E----,stack=[00,bf,eb,04,76,c9,11,04,76,04,76,10,9e] 
08B7:    JMP $08a4
It's obviously something I haven't emulated properly, but what?
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

A degree of sound and disk emulation wasn't the only thing I've been busy on over the past three weeks or so. I've also been working on this:
joric_irq_bench_1.png
joric_irq_bench_2.png
joric_irq_bench_3.png
Is that looking about right?

This tool was very useful in finding a couple of bugs in my VIA emulation.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: JOric

Post by Chema »

I don't know why I did not notice the first part of your previous answer. Sorry. Yes I am quite a fan of adventure games, both graphic and text :)

It is nice to see that you are also interested in how they were programmed, because that search was what set me into creating my engine :D

Back to this issue, indeed that is a ROM routine. Strange because in Space 1999 at that point the Overlay Ram should be active and Oric's ROM inactive.

But if that was not correctly emulated, then all the programs using overlay ram should have similar problems, such as Blake's 7.

Mmmm... The only difference might be in how overlay ram/rom are selected. In B7 and modern demos (probably other games too) ROM is inactive all the time from boot, while in Space 1999 and 1337 rom is switched in and out at least once (due to the way the OS loader works, IIRC). Switching ROM in and out is made by bit 1 in register in $314 (Microdisc electronics). Bit 1 set to 0 means ROM off and overlay RAM in. You might want to check if that switching in and out behaviour is correctly emulated.

EDIT: And again you were faster :) Anyway I will think about your last posts in case I see something, but I'd bet the ROM is active when it should not.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

dreamseal wrote: Thu Apr 19, 2018 11:26 pmThis tool was very useful in finding a couple of bugs in my VIA emulation.
I'm glad this tool from 2011 is still useful so long after it was done :)
(Reference to this page: viewtopic.php?t=718&start=15)

Your results seems very good, the only difference I see is on the "Normal Oric boot with IRQ", and to be honest, I don't remember what was the difference was...
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Dbug wrote: Fri Apr 20, 2018 6:46 pm Your results seems very good, the only difference I see is on the "Normal Oric boot with IRQ", and to be honest, I don't remember what was the difference was...
Yeah, it would be good to track down what that difference is. I'll have to take a closer look.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Chema wrote: Thu Apr 19, 2018 11:42 pm Back to this issue, indeed that is a ROM routine. Strange because in Space 1999 at that point the Overlay Ram should be active and Oric's ROM inactive.
I have noticed (by putting some logging in) that the BASIC ROM is enabled and disabled multiple times after startup of the game. Is that expected? If not then I must have something wrong.
Chema wrote: Thu Apr 19, 2018 11:42 pm But if that was not correctly emulated, then all the programs using overlay ram should have similar problems, such as Blake's 7.
Blake's 7 is definitely working. I was just having another little go this evening. I love how it has all the LucasArts features, such as room scrolling.
Chema wrote: Thu Apr 19, 2018 11:42 pm Mmmm... The only difference might be in how overlay ram/rom are selected. In B7 and modern demos (probably other games too) ROM is inactive all the time from boot, while in Space 1999 and 1337 rom is switched in and out at least once (due to the way the OS loader works, IIRC). Switching ROM in and out is made by bit 1 in register in $314 (Microdisc electronics). Bit 1 set to 0 means ROM off and overlay RAM in. You might want to check if that switching in and out behaviour is correctly emulated.
I'll take a closer look. In theory I have that emulated, but there might be a bug in there.

I have noticed that Buggy Boy is hanging as well, just after it starts playing some noise at the start. The noisy graphics hangs, i.e. the image hangs and becomes still, but the noise continues to play.

I've also noticed that for Rambo, the music appears to play to the end without any issue, but when the program finishes, the keyboard isn't working, whereas in Oricutron I can type in LIST, and RUN again. Not in JOric. Not sure yet why the keyboard emulation is not working after the Rambo program finishes.

So a few things to take a closer look at.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

Based on the symptoms, I'd say that you are having problems with all the SEDORIC based programs (Space 1999, Buggy Boy...).
These tend to switch between the ROM and the Overlay, while more recent demos and games (Blakes, Pushing...) are never enabling the ROM at all.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

It appears that the main problem affecting all of these, i.e. 1337, Buggy Boy, and Rambo, is the VIA interrupt enable register value. It seems that in all three cases, all interrupts are disabled at the point that it freezes, so there's no IRQs happening at all. If I set a breakpoint and change the value in the debugger to enable timer 1 interrupts, then they all spring back into life. Must be something wrong in my VIA interrupt implementation then. Hopefully will track it down soon.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Okay, that's fixed now. When reading the IER register, the top bit must always be set. That's all it was. I was always returning the top bit as 0, which appears to be what the original 1977 MOS datasheet says, but other datasheets such as the Rockwell and WDC say it should be logic 1.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Yay!!
joric_space_1999_2.png
joric_space_1999_3.png
That's me occupied for the rest of the evening then.
Post Reply