GEMS Jukebox

Announce (tech) demos or games releases

Moderator: Mask of Destiny

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

GEMS Jukebox

Post by r57shell » Mon Jun 03, 2013 8:39 am

This ROM - just tool for testing GEMS banks.
Please test it on real hardware.
Nothing special, but some bugs can be revealed.

http://elektropage.ru/r57shell/Player.bin

Multiple music playing at once - not bug. This is particularity of driver.
For music test: play music in BGM, and SFX in SFX.
Only developer knows where is SFX and where BGM.
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jun 03, 2013 5:44 pm

Two things on real hardware: first, you need to put "SEGA" at 0x100 to pass TMSS. You don't need to have an entire header like SEGA specified, but not having "SEGA" at 0x100 means it won't run on TMSS models.

Second, it doesn't respond to the controller on real hardware. It may be something to do with your pad routines, or it may have something to do with your timing or int handling. On real hardware, you get the jukebox display, and it's stuck sitting on the BGM setting.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon Jun 03, 2013 6:28 pm

Chilly Willy wrote:first, you need to put "SEGA" at 0x100 to pass TMSS.
Ahhh. This is my mistake. Somehow removed it when edited :S.
Chilly Willy wrote:Second, it doesn't respond to the controller on real hardware.
It may be just error occured somewhere, and all processes stucked. So, now VBLANK counter and UPDATE counter added. Both must grow up at every frame.

First, I do init of joypads sending $40 to four ports, but then I read only two of them. Reading of joypad occurs in VBLANK. Is it correct?

Updated file on same link.
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jun 03, 2013 6:54 pm

r57shell wrote:It may be just error occured somewhere, and all processes stucked. So, now VBLANK counter and UPDATE counter added. Both must grow up at every frame.
Neither updates on real hardware, but do in Gens/GS (what I use for testing on PC).
First, I do init of joypads sending $40 to four ports, but then I read only two of them. Reading of joypad occurs in VBLANK. Is it correct?
If you are using sgdk, you shouldn't do anything with the ports yourself. All that is handled for you as shown in the example apps. In sgdk, the joypads are automatically enabled and read in the vblank. Things like mice and light guns need to be enabled using JOY_setSupport before they start being read in the vblank.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon Jun 03, 2013 7:20 pm

Thanks for fast testing!
Chilly Willy wrote:Neither updates on real hardware
It explains many things :)
Chilly Willy wrote:If you are using sgdk, you shouldn't do anything with the ports yourself
I don't use sgdk. Plain ASM only. Only hardcore :]

Removed reading z80 RAM, and updated rom on same link.
If it will not work, then I will cut off all parts of driver, and leave UI alone.( in the dark :) )
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jun 03, 2013 8:00 pm

r57shell wrote:Thanks for fast testing!
No problem... I know what a pain it is to have to try to work out bugs on real hardware when you don't have a way to try it yourself.
I don't use sgdk. Plain ASM only. Only hardcore :]
In that case, the pads are read when you read them. It's not an automatic thing. Most people make the pad reading the last thing they do in the vblank int routine. You don't NEED to do it there, but you should avoid reading the pad more than once per frame - many newer pads (6 button in particular) go spastic if you read them too often.
Removed reading z80 RAM, and updated rom on same link.
If it will not work, then I will cut off all parts of driver, and leave UI alone.( in the dark :) )
Okay, the current version reads the pad, but doesn't update the screen at all. You can change the options and play sfx and bgm, but the screen doesn't change... unless you play music and wait - eventually the center of the screen fill with trash.

EDIT: The level meters no longer update, even in emulation. You definitely screwed up something there. :D

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon Jun 03, 2013 9:15 pm

Chilly Willy wrote:EDIT: The level meters no longer update, even in emulation. You definitely screwed up something there. :D
Hehe, I knew where was problem :).
Yes, as I told, I turned off reading z80 RAM (for meters and tempo).
Chilly Willy wrote:Okay, the current version reads the pad, but doesn't update the screen at all.
Must work all except tempo update, and visualization.

So, next question is: how correctly read z80 RAM.
now code is:

Code: Select all

move.w    sr,-(SP)
or.w #$0700,sr
hold z80 bus
read z80 RAM
release z80 bus
move.w  (sp)+,sr
And, this not work on real hardware. May be problem not here. May be problem with not correct reading from z80. First, I will turn on this function, but cut off reading RAM, so, only hold z80 and releaze z80 will left.

Updated again.

Thanks again.
Last edited by r57shell on Mon Jun 03, 2013 9:37 pm, edited 1 time in total.
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jun 03, 2013 9:33 pm

Okay, the display updates on emulation, but still doesn't on real hardware. The center section still fills with garbage after several seconds (on real hardware). I'd guess maybe you're screwing up the VDP command in an interrupt or something.

Also, the SFX control plays music, not SFX. The DAC control plays a drum hit, so it's probably okay.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon Jun 03, 2013 9:41 pm

Chilly Willy wrote:Also, the SFX control plays music, not SFX.
r57shell wrote:Only developer knows where is SFX and where BGM.
It is particularity of driver. So you need to assume, you can play music "as" sfx. For example: wind in loop, or another ambient.

I think, I found bug. Updated again.
It's strange, that all of emulators worked with it: RetroArch, MESS, Gens Surreal, Gens rerecording 11b, Regen, Kega Fusion.
Exodus not tested, because I don't have good PC for that. :D

EDIT: now, last command of DMA from RAM: move.l (sp)+,($C00004)
I hope all will work now.
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jun 03, 2013 11:58 pm

Still no update of the display on real hardware, and now it no longer plays music. You get one tiny blip from the speaker and nothing else.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Tue Jun 04, 2013 12:33 am

Turned off z80 RAM read again. Modified move.l, to use move.w.
I see, that I don't understand DMA, particularly from RAM.
Image

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Jun 04, 2013 12:37 am

Well, it's back to playing music, but it still doesn't update, and eventually trashes the display.

Ti_
Very interested
Posts: 82
Joined: Tue Aug 30, 2011 7:50 am

Post by Ti_ » Tue Jun 04, 2013 7:15 pm

r57shell wrote:Turned off z80 RAM read again. Modified move.l, to use move.w.
I see, that I don't understand DMA, particularly from RAM.
Maybe problem with someone else? example: RRRHack AFAIK works ok on flash cartridges without 'special' requirements for dma and other shit like bus captures into joysticks.
P.S. Hi :D

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Tue Jun 04, 2013 7:27 pm

Main problem is that this ROM done almost from BLANK.
But when you do hacks: mostly all work with hardware already writed with developers of the game.

Ahaha... My first version of rome which was posted here, works even on Exodus. With little bug at bottom of screen.
Image

Ti_
Very interested
Posts: 82
Joined: Tue Aug 30, 2011 7:50 am

Post by Ti_ » Tue Jun 04, 2013 8:06 pm

r57shell wrote:Main problem is that this ROM done almost from BLANK.
But when you do hacks: mostly all work with hardware already writed with developers of the game.
Попробуй tst.w (word_0_C00004).l добавь сразу после инита, во многих ромах есть.
Кстати ещё можно добавить ожидание дма там же, что связано с тем что оно не останавливается после кнопки сброс и это может вызвать баги после сброса. в том же роме ррр есть, и порты там вначале не так. Там 6 штук - в три идет 0, в три $40.

Насчет хаков - дак было, но я выпилил чето там, а в новом коде и подавно нету, и ниче у шумахера работало всё даже с моуд1. только у сегамана висло на гофере, и то на 2-ой планете :D

English:
Try to add tst.w $C00004.l after init, it exist in most ROMS.
Also you may try to 'wait dma' after init, it's bugged dont stop if reset. Ports - in RRR it writes 00 to some 3 ports, and $40 to some 3 other.

About hacks - yes, but I cut off some things, and new code doesn't have it , but it still works on 3DShumacher cart, and afaik even mode1 works fine. Game freezes only Segaman's sega gopher and only sometimes on 2nd planet.
Last edited by Ti_ on Wed Jun 05, 2013 7:13 am, edited 1 time in total.

Post Reply