Tonma Le 09/10/2018 à 16:40 Hi,
I start some tests to create a game on NeoGeo CD and before starting the development, I wish to test specific hardware features.
I can play CD audio wav files (in raine emulator) and the graphic part works too.
I wish to load all sprites at the beginning and only load a different .SPR for the background every level.
In the "IPL.TXT" I have a demo.spr (135ko) and demo2.spr (35ko). I wish to put the second file in the start of the bank 3 (name, num bank, start offset of the bank) but the NeoGeoCd doesn't like it and show me an error message DISC I/O error ID = 0000
Without the line demo2.spr,3,0, the game run but with a blank square instead of the sprite (because it didn't load)
DEMO.FIX,0,0
DEMO.Z80,0,0
DEMO.PCM,0,0
DEMO.SPR,0,0
DEMO2.SPR,3,0
TEST.PRG,0,0
I use buildchar file to create demo.spr :
<?xml version="1.0" encoding="UTF-8"?>
<chardata>
<setup>
<starting_tile>256</starting_tile>
<charfile>out\char.bin</charfile>
<mapfile>out\charMaps.s</mapfile>
<palfile>out\charPals.s</palfile>
<incfile>out\charInclude.h</incfile>
<incprefix>../</incprefix>
</setup>
<pict id="monstre"> <file>gfx\monstre.png</file> <flips>xyz</flips> </pict>
<pict id="bg_001"> <file>gfx\lb2.png</file> </pict>
<pict id="girl3"> <file>gfx\girl_3.png</file> <flips>xyz</flips> </pict>
</chardata>
and demo2.spr :
<?xml version="1.0" encoding="UTF-8"?>
<chardata>
<setup>
<starting_tile>0</starting_tile>
<charfile>out\char2.bin</charfile>
<mapfile>out\charMaps2.s</mapfile>
<palfile>out\charPals2.s</palfile>
<incfile>out\charInclude2.h</incfile>
<incprefix>../</incprefix>
</setup>
<pict id="girl4"> <file>gfx\girl_4.png</file> <flips>xyz</flips> </pict>
</chardata>
HPMAN Le 09/10/2018 à 17:47 Error 0000 usually means file not found, make sure it's on your disk
HPMAN Le 09/10/2018 à 19:06 Add this asm snippet to your project
;loadList(char *list)
.globl loadList
loadList:
move.l 4(a7), a0 ;* a0=file list
movem.l d2-d7/a2-a6, -(sp)
jsr 0xc00552
movem.l (sp)+, d2-d7/a2-a6
rts
Then you can call loadList from C with a correct file list.
Tonma Le 10/10/2018 à 11:30 Thanks,
I tried your asm function but I have error I/O. And this time I checked twice the presence of the file. I don't know how create a correct file list.
I found this example in the wiki :
"STAGE_2.SPR" ;Name
0x02 ;Bank
0x00 ;align
0x00001600 ;Destination
With C :
void loadList(char *list);
char *bgspr = "DEMO2.SPR0,$300000"; // $(bank3)(align=0)(adress=0000)
if (p1e&JOY_B) {
loadList(bgspr);
}
With asm only :
.globl loadList
loadList:
move.l #ListFile, a0
movem.l d2-d7/a2-a6, -(sp)
jsr 0xc00552
movem.l (sp)+, d2-d7/a2-a6
rts
ListFile:
.ascii "DEMO2.SPR"
.byte 0x03
.byte 0x00
.long 0x00
@blastar
I tested with mame 0.202 but I have the same error. The music files are only played one time.
I use the HPMAN code to play music file n°2 with loop and leave the CDDA_FLAG to 0
__asm__ (
"move.l %0, %%d0 \n"
"movem.l %%d2-%%d7/%%a2-%%a6, -(%%a7) \n"
"jsr 0xc0056a \n"
"movem.l (%%a7)+, %%d2-%%d7/%%a2-%%a6 \n"
:
:"r"(0x0402)
:"d0", "d1", "a0", "a1", "cc"
);
has this ever been verified on real hardware?
I also blindly trusted the NeoDev-wiki '$04: Read track and loop (confirmed)' and never really tested it. I can NOT reproduce it on the real hardware, neither via the direct BiosCall nor via the Z80... there must be something wrong.
maybe the confirmation is because it works with RAINE but this emulator is not accurate.
no luck with:
TOPLOADER + UNIBIOS 3.3
FRONTLOADER (unmodified)
HPMAN Le 10/10/2018 à 20:12 Compiler might be doing some alignment with the ascii string when compiling (adding a pad byte), leading to bad format. Check out the output binary data.
Tilemaps must match the location where you load the tile data!
Bank 3 starts at (3*1048576)/128= tile #24576
<starting_tile fillmode="none">24576</starting_tile>
Note the fillmode attibute to indicate you don't want the padding tiles.
This will generate the correct tilemap for loading the data @ 0x300000