Izumic Ballade freeze during intro and battle

By wyrdwad

Hero (653)

wyrdwad's picture

15-01-2018, 03:47

Hey all,

Bit of a long shot here, but figured I'd post anyway and see if anyone had any ideas.

I recently got ahold of a repro cart of Pleasure Hearts, which I found myself getting really addicted to, so I decided to try out M-Kai's previous two games: Kyokugen, and Izumic Ballade. I downloaded them both from MRC's downloads section, and played a bunch of Kyokugen first without any issue (and man, that game's even better than Pleasure Hearts!). I then popped in Izumic Ballade, and that one booted too without any trouble, but... well, it froze on me during the intro. Sort of.

Basically, when it got to 9:25 in this video, it just kind of... hung there:

https://youtu.be/yZy9J5x6r7w?t=9m25s

After the teacher said きゅうけい! (Japanese for "Break time!", basically), the intro just kind of stopped moving forward. But my system wasn't frozen! I could still press keys on the keyboard, and I'd hear the telltale "click" sound each time I did so. And if I pressed the space bar, it went back to the title screen and let me play the game, seemingly without any further trouble.

That is, until I played for another hour or so and got into a battle. Although I'd been in several other battles at that point without any trouble, this one just... froze up after the enemy attacked me, without ever displaying the menu that let me choose a battle option. The battle music was still playing, but the game couldn't be continued -- I had to reset my MSX.

I thought maybe I'd written it to a disk with a bad sector, so I tried writing the game to several other disks, but they all freeze during the intro in that same exact spot. Since the game was written in MSX-BASIC, however, I decided this last time to hit Ctrl+Stop when it got to that part, which exited the game with a "break in 85." I then did a LIST, and when it got to line 85, I hit the pause key and took a photo with my digital camera:

https://i.imgur.com/YbbDKJh.jpg

This is the line where my MSX is getting stuck during the intro, and if I can figure out why, maybe I can also figure out why it froze during battle as well. Which would be cool, because I like what I'm seeing of this game and would really like to play it, but if it's going to keep freezing on me, it's going to be a difficult task playing through it.

For technical specs, I'm using a Panasonic FS-A1WX Japanese MSX2+ system with the base 64 KB RAM and 128 KB VRAM, and playing at 60 Hz NTSC speed (unlike the video, which is at 50 Hz PAL speed).

And this is the download I used when writing my disk:

https://www.msx.org/downloads/games/role-playing-games-rpg/i...

If anyone can shed any light on why the game would have trouble advancing beyond the teacher's break time, I'd be very grateful.

(As one final piece of info, it should be noted that there's one other difference between the video and what I'm seeing: at the top of the screen in the linked video, it says "1 2 3 (omega) AE", but on my screen, it says "1 2 3 はい" -- I assume this is because the system playing the game in the video is not Japanese, but it seems odd that every other bit of Japanese text is displaying just fine for Msxresources, while that one lone はい is not.)

Anyway, please let me know if you're able to figure anything out, and thanks!

-Tom

Login or register to post comments

By POKE

Supporter (3)

POKE's picture

20-01-2018, 00:03

Hi, was just curious and tried the game. I can't help with Japanese and game playing, but I tested the game on blueMSX v2.8.2 (33879) using the default MSX2 profile and it doesn't appear to freeze during the presentation. You may give it a try and see if works. Hope this helps. Regards.

By wyrdwad

Hero (653)

wyrdwad's picture

20-01-2018, 22:00

Hey POKE,

I'm something of a gaming purist, so I try to avoid emulation whenever possible -- I'm mostly interested in playing the game on real hardware, and the only hardware I've got is my FS-A1WX.

I have put several hours into the game now, though (it's pretty addictive!), and can add the following details:

It doesn't ALWAYS freeze during battle, and in fact is usually just fine. I've had it freeze maybe 5 or 6 times over the 6 or 7 hours I've put into it, and it's always during an enemy's turn -- and I noticed that when it freezes, it freezes in the middle of the sound effect when the enemy hits me with a regular attack, as the sound effect kind of gets "stuck" and continues to play, endlessly (which is odd, because the music continues behind it without any interruption -- it's ONLY the sound effect that gets stuck).

Additionally, I've tried hitting Ctrl+Stop to break out of the game and figure out what line it was getting stuck on each time it's frozen on me during battle, but to no avail: Ctrl+Stop don't function at that time. I suspect maybe the game wasn't *entirely* programmed in BASIC, but only partially, with the main game (after the intro) likely being a compiled binary program.

Thank you for looking into this, though, POKE! I appreciate you taking some time to try to figure it out.

-Tom

By wyrdwad

Hero (653)

wyrdwad's picture

24-01-2018, 10:05

On further play (I can't stop! It's weirdly addictive!), I've discovered that the freezing always occurs when an enemy hits me with a regular attack, and I think it has something to do with the code to make the screen shake. See, the screen only shakes when you get hit with a regular physical attack -- it doesn't shake when you hit an enemy, nor when an enemy hits you with a special attack. And every time it freezes, it happens right after an enemy flashes, indicating that it's initiated a regular attack on me. If the enemy missed, it would say スカ! over my character, and the game would continue normally. If the enemy hit, it should cause the screen to shake, followed by the amount of damage the enemy inflicted on me written in white over my character.

However, instead of that happening, the game just freezes after the enemy flashes to indicate it initiated a regular attack on me. There's no スカ! to indicate it missed, but also no screen shake and no white number appearing over my character to indicate that it hit -- the game just stops processing at that point.

Based on the exact timing of when these freezes occur, my best guess is that the screen shake is the culprit. For whatever reason, whatever coding is being used to cause the screen to shake must have some kind of bug in it that causes a rare freeze glitch -- perhaps it generates screen coordinates randomly for the shake, and there's a chance one of the coordinates it might generate is out of bounds, causing some kind of endless loop to occur (which might explain why the music still plays, even though the sound effect gets stuck and the game won't progress).

At any rate, since I know we have some pretty talented programmers on here, I figured I'd give all this information and see if (1) anyone else can reproduce this, and (2) anyone can figure out what the cause is and maybe create a patch or something to fix it!

As an added incentive to bust into the code of this game, I'd like to offer my services as a translator to actually translate the game to English so more people can play and enjoy it! It seemingly has a pretty small amount of text in it for an RPG, based on what I've played so far (there's only one town, and most NPCs apparently never change what they say), so I don't think it would take too long... yet it's a bizarre and interesting enough game that I think if more people could read the text, they'd probably enjoy it quite a bit.

So if any enterprising programmers out there are reading this, take a look at this game's code and see if you can rip the text... and also if you can figure out any errors in the logic used to make the screen shake when you get hit by an enemy that could cause a rare freeze bug to occur!

I'd be most appreciative. Wink

-Tom

By wyrdwad

Hero (653)

wyrdwad's picture

03-02-2018, 07:20

Update: I may have fixed the freeze! I can't say with 100% certainty, though, since (1) it happens entirely at random, so it may just not have happened again yet in my testing, and (2) I'm still not entirely sure what the actual CAUSE of the freeze was -- I mostly just fixed it by removing the element that seemed to be its trigger.

As such, I'd like someone who's more familiar with MSX-BASIC and the way the MSX2+ hardware functions to read over what I did, and see if they can give any input as to why this might have been the cause of the issue.

Basically, I realized that the freezes only ever seem to occur when I successfully get hit by an enemy during battle -- and the two things that happen every time I get hit are (1) a screen shake, and (2) a sound effect. So I figured, most likely, one or the other of those things was the cause of the freeze in question.

Dissecting the source code, I found that all occasions where the screen shakes and a sound effect plays when the player successfully gets hit by the enemy are located on the following lines of the following .bas files:

main.bas, line 990:

990 GOSUB1760:IFZ=0THEN1000ELSEPLAY"O2L32V13CEC","S9M999B8":FORI=0TO31:VDP(19)=RND(1)*256:NEXT:VDP(19)=0

bh.bas, lines 650 and 1950:

650 GOSUB1360:IFZ=0THEN660ELSEPLAY"O2L32V13CEC":FORJ=15TO7STEP-3:FORI=0TO31STEP16:SOUND9,J:SOUND6,31:SOUND10,J:SOUND2,I+230:SOUND3,I\9:SOUND13,0:VDP(19)=RND(1)*256:NEXTI,J:A=USR4(0):VDP(19)=0
1950 PLAY"L32O1V15CCDCDCGECDC":FORI=255TO0STEP-4:VDP(19)=RND(1)*I:COLOR=(0,0,0,0):NEXT:RETURN

And bi.bas, lines 640, 2130, and 2160:

640 GOSUB1320:IFZ=0THEN650ELSEA=USR4(0):PLAY"O2L32V13CEC","S9M999O4B16":FORI=0TO15:VDP(19)=RND(1)*256:NEXT:VDP(19)=0
2130 PLAY"L32O1V15CCDCDCGECDC":FORI=255TO0STEP-4:VDP(19)=RND(1)*I:COLOR=(0,0,0,0):NEXT:RETURN
2160 FORO=0TO44:VDP(19)=RND(1)*256:SX=0:SY=RND(1)*152:M$="Cl]県何[kanjiunknown2]私全[kanjiunknown1][flamesymbol]私来私前楽Cl]会元[flamesymbol]全会県来全会[kanjiunknown2]動者何私表Cl][Bs[kanjiunknown1]":GOSUB180:NEXT:M$="『う、うわあーーっ!![yensymbol]":GOSUB140:GOSUB2120:SETPAGE3,3:CLS:Y=0:FORI=0TO211STEP16:O=RND(1)*32:LINE(Y,I)-(Y+O,I+15),13:Y=Y+O:NEXT:A=USR6(1)

(Ignore the messed-up M$ part of that last one; that's from my attempts at reading data for fan-translation purposes, and was not present on the game disk itself, where I made my edits.)

My first thought was that the VDP(19)=RND(1)*256 might have been at fault, since if the random number generated ever happens to be exactly 1, this will be processed as VDP(19)=256, which is an illegal function call (since that VDP register cannot be assigned any value over 255). So I changed all occurrences of that to VDP(19)=RND(1)*255... but sadly, the crash still occurred when I was testing the game afterward. (I left that change intact, however, because I figure it's still probably better to be safe than sorry!)

So what I did next was... basically, just remove every single PLAY and SOUND command from the code on all of the above-noted lines. This means that when I'm struck by an enemy, the screen still shakes, but there's no longer any sound effect that plays. Which would be a shame if that particular sound effect were any good, but fortunately... it's not. Wink So removing it is definitely no big loss.

AND, the game has yet to freeze on me since I removed these statements from the code. So I *think* one or more of them was the cause of the problem.

My best guess? Since there's music playing during battle, maybe the sound effects were occasionally being told to play at a time when there simply wasn't an open channel available for them (or two open channels, in the case of PLAY statements with multiple arguments). Like, maybe the music happened to be at a point where a note was being played on every single channel of the FM sound chip at once, and it was at that exact moment that sound effect data was ALSO sent to the FM sound chip -- and since the game was being told to play sounds on more channels simultaneously than it's capable of, it just kind of crapped itself. Wink

I have no idea if that's actually the reason why, but tentatively, removing these PLAY and SOUND commands *seems* to have fixed the freeze. So I just figured I'd let you guys know, in case anyone else ever experiences similar difficulty!

Please let me know if my theory holds water, or if you have any other explanations for this. And thanks for reading!

-Tom

My MSX profile