Uridium by Trilobyte - Pre-order the Cartridge set

Page 25/28
18 | 19 | 20 | 21 | 22 | 23 | 24 | | 26 | 27 | 28

By frederic.markus

Expert (82)

frederic.markus's picture

18-11-2014, 16:03

Got my cartridge! Awesome! Amazing work!
I have a MegaFlashROM SCC+ SD in slot 2 trying to use that to get the SCC sound be the game crashes after the intro.
Any idea if this can be solved?
Cheers!

By ARTRAG

Enlighted (6933)

ARTRAG's picture

18-11-2014, 18:22

Try in opfx /c to erase the flash rom and /u to disable its subslots
I will try to reproduce the issue but I do not have the real thing
I will be able to analyse the problem only if openmsx shows the glitch

By ARTRAG

Enlighted (6933)

ARTRAG's picture

18-11-2014, 20:35

I'm reproducing the issue on openmsx: the SCC seems detected (you can switch it on and off in the menu) but it is totally silent and if you try to start the game with it active you get a system crash just after the intro sequence.
If you switch it off you get the normal PSG game.

If this is the problem you are facing, I will investigate it on openmsx.

By ARTRAG

Enlighted (6933)

ARTRAG's picture

18-11-2014, 21:50

Apparently the SCC slot is not detected correctly...
I'm using this snippet, maybe GuillianSeed could say faster than me what does not go with it when used with his MegaFlashRom scc+sd

;------------------------------------------------------------
; SCC-search v1.0
; by Alwin Henseler
; using method described in bulletin # 18 MSX-club Enschede
; input: none
; output: B=slot that contains SCC (=255 if no SCC found)

; enaslt:          equ #0024
; exptbl:          equ #fcc1
; slttbl:          equ #fcc5




begin:
	MAP #c000
	in a,(#a8)        ; read prim. slotregister
	rra
	rra
	rra
	rra
	and %00000011     ; A = prim.slot page 2
	ld b,0
	ld c,a
	ld hl,exptbl
	add hl,bc
	bit 7,(hl)        ; page 2-slot expanded ?
	jr z,scctest
	ld hl,slttbl
	add hl,bc
	ld a,(hl)         ; A = sec.sel.reg. of page 2-slot
	rra
	rra
	and %00001100     ; bit 1/2 = sec.slot page 2
	or c
	set 7,a           ; compose sec.slot-code
scctest:
	push af           ; save page 2-slot on the stack
	ld a,(exptbl)     ; 1st slot to test

testslot:        
	push af           ; save test-slot on the stack
	ld h,#80
	call enaslt       ; switch slot-to-test in 8000-bfffh
	xor	a
	ld (0xbffe),a	  ; scc+ patch for bluemsx
	ld hl,#9000
	ld b,(hl)         ; save contents of address 9000h
	ld (hl),#3f       ; activate SCC (if present)
	ld h,#9c          ; address of SCC-register mirrors
	ld de,#9800       ; 9800h = address of SCC-registers
testreg:         
	ld a,(de)
	ld c,a            ; save contents of address 98xxh
	ld a,(hl)         ; read byte from address 9cxxh
	cpl               ; and invert it
	ld (de),a         ; write inverted byte to 98xxh
	cp (hl)           ; same value on 9cxxh ?
	ld a,c
	ld (de),a         ; restore value on 98xxh
	jr nz,nextslot    ; unequal -> no SCC -> continue search
	inc hl
	inc de            ; next test-addresses
	bit 7,l           ; 128 addresses (registers) tested ?
	jr z,testreg      ; no -> repeat mirror-test
	ld a,b
	ld (#9000),a      ; restore value on 9000h
	pop bc            ; retrieve slotcode (=SCC-slot) from stack
	jr done           ; SCC found, restore page 2-slot & return

nextslot:
	ld a,b
	ld (#9000),a      ; restore value on 9000h
	pop bc            ; retrieve slotcode from stack
	bit 7,b           ; test-slot = sec.slot ?
	jr z,nextprim
	ld a,b
	add a,4           ; increase sec.slotnumber
	bit 4,a           ; sec.slot = 4 ?
	jr z,testslot
nextprim:
	ld a,b
	and %00000011
	cp 3              ; prim.slot = 3 ?
	jr z,noscc
	inc a             ; increase prim.slotnumber
	ld d,0
	ld e,a
	ld hl,exptbl
	add hl,de
	or (hl)           ; combine slot-expansion with slotcode
	jr testslot

noscc:           
	ld b,255          ; code for no SCC
done:            
	pop af            ; retrieve page 2-slot from stack
	push bc
	ld h,#80
	call enaslt       ; restore original page 2-slot
	pop bc
	ei
	ret
end:
	endmap				 
; -------------------------------------------------------------


; ====================
;    Initialization
; ====================
SCCINIT
	ld	hl,begin
	ld	de,0C000H
	ld	bc,end-begin+1
	ldir
	call	0C000H
	ld	a,b
	ld	(SCC),a
	ret

; SLOT            .db     0
; PAGE1RAM        .db     0
; RAMSLOT         .db     0

; SCC             .db     0
; SUB             .db     0FFH

By Manuel

Ascended (19309)

Manuel's picture

18-11-2014, 22:12

What's this about:

Quote:

ld (0xbffe),a ; scc+ patch for bluemsx

By frederic.markus

Expert (82)

frederic.markus's picture

18-11-2014, 22:24

Yes this is exactly the problem that I have. Thank you for investigating Wink I haven't formatted the sd yet.

By ARTRAG

Enlighted (6933)

ARTRAG's picture

18-11-2014, 22:37

SCC+ chips by default, on real HW, start in SCC mode.

Bluemsx has a wrong initialization for this kind of chips, which start in SCC+ mode.
Setting to 0 the mode register at BFFEh should set manually SCC+ in SCC mode, thus working around the emulation bug in bluemsx.

By Manuel

Ascended (19309)

Manuel's picture

18-11-2014, 23:21

Yikes, code that works around emulator bugs! Sad IMHO, the emulator should be fixed, not the code...

Are you sure this is not fixed in the latest blueMSX?

(If there's any openMSX bug you're running into, please report it and we'll fix it, never make a workaround.)

By ARTRAG

Enlighted (6933)

ARTRAG's picture

19-11-2014, 09:36

Totally sure, bluemsx manteinance has stopped ages ago

By Guillian

Prophet (3516)

Guillian's picture

19-11-2014, 11:59

ARTRAG wrote:

Apparently the SCC slot is not detected correctly...
I'm using this snippet, maybe GuillianSeed could say faster than me what does not go with it when used with his MegaFlashRom scc+sd

In which slot is detected?
If you send me the ROM I'd have a look at it.

The rutine seems fine, but I would change this:

	jr z,testreg      ; no -> repeat mirror-test
	ld a,b
	ld (#9000),a      ; restore value on 9000h

That would select an undefined bank. It is better to leave bank #3F or manually select bank 3 (default bank).

Also, I agree Manuel: don't work around emulator bugs.

Page 25/28
18 | 19 | 20 | 21 | 22 | 23 | 24 | | 26 | 27 | 28