Oricutron v0.1 (now 0.8)

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:

Post by Chema »

Really nice and impressive work, Xeron... congratulations!

Just tried it and it runs nicely both space:1999 and 1337.

However there is a notable difference in the sounds and music in 1337 between this and euphoric.

Not sure which is being more accurate (compared to the real machine that is), but it seems to me that the envelope generator is where this difference is more noticed. It seems that its frequency is not matched to the frequency of the notes in the same way as it is in Euphoric. At least the intro music for 1337 sounds quite horrible, like if some notes were out of pitch: those which use the EG as an effect.

Twilighte should test and help here, as I am completely lost in this subject... perhaps I can try other music compositions (maybe WAVE itself) and see what happens.

Any idea?
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

When it comes to sound, it is almost certainly Oricutron that is wrong. I'll investigate soon.
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

Can you send me a disk image that plays the 1337 music so i can compare euphoric and oricutron?
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Xeron wrote:Can you send me a disk image that plays the 1337 music so i can compare euphoric and oricutron?
Sure... which address?
jede
Flying Officer
Posts: 191
Joined: Tue Mar 14, 2006 11:53 am
Location: France

Post by jede »

Hello,

Good work :)

For the sound at the beginnning of quintessential demo, if it does not work well on your emulator, it's mainly because Twilighte, if i remember, use a feature on the via6522 : It does not work on all VIA6522. You should ask Twilighte. I think it's the shift register trick

Will you include 65816 emulation ?

Is there a way to add code easily to add some others hardware emulation ?

I am happy to see an emualtor working on my windows 7 computer (64bits) :)
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Jede: Only the end sample is using the SR
The two sample sequences (DTS and 20th century) are just normal 4 bit sample using the fast dual IRQ system.
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Post by ibisum »

Xeron wrote:Yes. Please apply the patches and commit them!
Alas I don't have commit ability right now, but here is a patch to get it built for GPH WIZ using the openwiz toolchain ..

Code: Select all

w1x@w1x0:~/hak/oric/oriculator.j/oricutron$ svn diff
Index: makefile
===================================================================
--- makefile	(revision 85)
+++ makefile	(working copy)
@@ -1,9 +1,11 @@
-PLATFORM ?= os4
+PLATFORM ?= linux
 # PLATFORM = win32
 # PLATFORM = beos
 # PLATFORM = haiku
 # PLATFORM = osx
 # PLATFORM = linux
+# PLATFORM = gphwiz
+# PLATFORM = aitouchbook
 
 VERSION_MAJ = 0
 VERSION_MIN = 1
@@ -74,6 +76,33 @@
 TARGET = oricutron
 endif
 
+# Linux-gph-wiz
+ifeq ($(PLATFORM),gphwiz)
+WIZ_HOME = /opt/openwiz/toolchain/arm-openwiz-linux-gnu
+WIZ_PREFIX = $(WIZ_HOME)/bin/arm-openwiz-linux-gnu
+CC = $(WIZ_PREFIX)-gcc
+CXX = $(WIZ_PREFIX)-g++
+AR =  $(WIZ_PREFIX)-ar
+RANLIB = $(WIZ_PREFIX)-ranlib
+CFLAGS += `$(WIZ_HOME)/bin/sdl-config --cflags`
+LFLAGS += -lm `$(WIZ_HOME)/bin/sdl-config --libs`
+TARGET = oricutron.gpe
+endif
+
+# AI touchbook OS
+ifeq ($(PLATFORM),aitouchbook)
+AITB_HOME = /usr/bin/
+AITB_PREFIX = $(AITB_HOME)arm-angstrom-linux-gnueabi
+CC = $(AITB_PREFIX)-gcc
+CXX = $(AITB_PREFIX)-g++
+AR =  $(AITB_PREFIX)-ar
+CFLAGS += `$(AITB_HOME)/sdl-config --cflags`
+LFLAGS += -lm `$(AITB_HOME)/sdl-config --libs`
+RANLIB = $(AITB_PREFIX)-ranlib
+TARGET = oricutron_AITB
+endif
+
+
 ####### SHOULDN'T HAVE TO CHANGE THIS STUFF #######
 
 all: $(TARGET)
Courtesy of your lovely code style, it builds like this:

Code: Select all

w1x@w1x0:~/hak/oric/oriculator.j/oricutron$ make clean
rm -f oricutron *.bak *.o
w1x@w1x0:~/hak/oric/oriculator.j/oricutron$ PLATFORM=gphwiz make
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c main.c -o main.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c 6502.c -o 6502.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c machine.c -o machine.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c gui.c -o gui.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c font.c -o font.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c monitor.c -o monitor.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c via.c -o via.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c 8912.c -o 8912.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-gcc -c disk.c -o disk.o -Wall -O3 `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --cflags`
/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/arm-openwiz-linux-gnu-g++ -o oricutron.gpe main.o 6502.o machine.o gui.o font.o monitor.o via.o 8912.o disk.o  -lm `/opt/openwiz/toolchain/arm-openwiz-linux-gnu/bin/sdl-config --libs`

(.. and also for PLATFORM=aitouchbook ..)

.. produces a .gpe that at least runs on the WIZ, even if there is no keyboard overlay yet, but I'll soon fix that ..

EDIT: I added a build target for the AI Touchbook as well .. oricutron runs really nicely on that machine! :)
Last edited by ibisum on Wed Feb 10, 2010 12:09 am, edited 1 time in total.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

For Quintessential issue with samples, the code during the DTS part looks like that:

Code: Select all

Flip:
PHA        ; $0000
LDA #$08
STA $030F
STX $030C
LDA #$266C ; Ptr Sample
STA $2F    ; ->Byte+1
AND #$0F
STA #$0F
LDA #$FD
STA $030C
STA $030C
LDA #$25   ; ->Flop
STA $FFFE
LDA #$304
PLA
RTI

Flop:
PLA        ; $0025
LDA #$09
STA $030F
STX $030C
LDA #$66   ; Byte
LSR
LSR
LSR
LSR
STA $030F
LDA #$FD
STA $030C
STA $030C
LDA #$00   ; ->Flip
STA $FFFE
LDA #$304
INC $0A	   ; ->PtrSample+1
BNE $004D
INC $0B    ; ->PtrSample+2
PLA        ; $004D
RTI
What the code does, is that $FFFE points on the Flip routine in zero page, that one reads one byte, patches flop, replays the bottom nibble, patches $FFFE to point on Flop; Flopy replays the top 4 bits and increment the sample pointer and patches $FFFE to point on Flip again.

Guess that's all :)
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

The second STA $030C is actually an STY. Here is my disassembly from oricutron (which i've confirmed is the same as euphoric). Unfortunately, euphoric's debugger doesn't show the AY regs so i can't see if the register DOES change, but as far as I can tell, it SHOULD. CA2/CB2 behaviour certainly matches oricutrons.

Code: Select all


X -> always $DD
Y -> always $FF

Flip:	      0000  48        PHA              
              0001  A9 08     LDA #$08        
              0003  8D 0F 03  STA VIA_IORA2    Put $8 on VIA port A
              0006  8E 0C 03  STX VIA_PCR      Set CA2/CB2 to 0/0 (AY ignore)
              0009  AD A4 1C  LDA $1CA4        Get sample
              000C  85 2F     STA $2F          Store it for Flop
              000E  29 0F     AND #$0F         And off lower nibble
              0010  8D 0F 03  STA VIA_IORA2    Write it to port A
              0013  A9 FD     LDA #$FD         
              0015  8D 0C 03  STA VIA_PCR      Set CA2/CB2 to 0/1 (AY write reg)
              0018  8C 0C 03  STY VIA_PCR      Set CA2/CB2 to 1/1 (AY set reg !!!!!!)
              001B  A9 25     LDA #$25         Set up for Flop
              001D  8D FE FF  STA $FFFE        
              0020  AD 04 03  LDA VIA_T1C_L    Acknowledge interrupt
              0023  68        PLA              
              0024  40        RTI              

Flop:	      0025  48        PHA              
              0026  A9 09     LDA #$09         
              0028  8D 0F 03  STA VIA_IORA2    Put $9 onto VIA port A
              002B  8E 0C 03  STX VIA_PCR      Set CA2/CB2 to 0/0 (AY ignore)
              002E  A9 66     LDA #$66         Get sample (SMC from Flip)
              0030  4A        LSR              
              0031  4A        LSR              
              0032  4A        LSR              
              0033  4A        LSR              
              0034  8D 0F 03  STA VIA_IORA2    Put sample on port
              0037  A9 FD     LDA #$FD         
              0039  8D 0C 03  STA VIA_PCR      Set CA2/CB2 to 0/1 (AY write reg)
              003C  8C 0C 03  STY VIA_PCR      Set CA2/CB2 to 1/1 (AY set reg!!!!!)
              003F  A9 00     LDA #$00         Set up for flip
              0041  8D FE FF  STA $FFFE        
              0044  AD 04 03  LDA VIA_T1C_L    Acknowledge interrupt
              0047  E6 0A     INC $0A          Next sample
              0049  D0 02     BNE $004D        
              004B  E6 0B     INC $0B          
              004D  68        PLA              
              004E  40        RTI              
I really don't know why it doesn't work in oricutron, especially now that other digi's work with the SVN code!
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

jede wrote:Good work :)
Thanks :)
Will you include 65816 emulation ?
Is there an Oric machine with a 65816?!
Is there a way to add code easily to add some others hardware emulation ?
What do you have in mind?
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

OH CRAPPY CRAP!

I figured out why the quintessential intro digi didn't work. I had CA2/CB2 as 1/1 to set the register, and 0/0 to do nothing, but its the other way around!

Somehow having this backwards works for everything but this digi... :-/
JamesD
Flight Lieutenant
Posts: 358
Joined: Tue Nov 07, 2006 7:38 am

Post by JamesD »

Xeron wrote:
jede wrote:Good work :)
Thanks :)
Will you include 65816 emulation ?
Is there an Oric machine with a 65816?!
Isn't there that Super Oric that someone built?

If the 6502 were socketed it would be easy to add one. Dang cost cutting measures make this kind of upgrade difficult on a lot of machines.
User avatar
Xeron
Emulation expert
Posts: 426
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Post by Xeron »

I didn't think the 65816 was a drop-in replacement?
User avatar
thrust26
Officer Cadet
Posts: 49
Joined: Wed Jan 27, 2010 7:34 pm
Location: Düsseldorf, Germany

Post by thrust26 »

How about "illegal" opcode support?

http://www.oxyron.de/html/opcodes02.html

Only the grey ones as the others are unstable anyway.
Have fun!
thrust26
JamesD
Flight Lieutenant
Posts: 358
Joined: Tue Nov 07, 2006 7:38 am

Post by JamesD »

Xeron wrote:I didn't think the 65816 was a drop-in replacement?
It's not but the 65802 is.

There are simple interfaces for the 65816 that let it plug into a 6502 socket. The logic isn't that complex.
Post Reply