Undefined opcode

Stuck? This is the place to go to get and give help.

Undefined opcode

Postby kevman323 » January 8th, 2014, 8:24 am

I am currently working on a project that requires a LOT of variable storage, and I am running into some errors that I think may be caused buy the many arrays that I need for the game.

When I run the game through the DSGM emulator (it compiles fine), one of 3 things can happen: It can work completely fine, it can say "The rom image has crashed", or it can say "Undefined opcode - with no debug vector defined".

The part of the code that causes the problem is in the "createFloorObject" object, and in the "Set floor layouts" section. What this part of the code is doing is reading room layouts from a text document and inputing the info into several arrays, roomDatObject[7][7][50], roomDatX[7][7][50], and roomDatX[7][7][50]. There is a 7X7 grid of rooms, and each room contains 50 object type/x position/y position values.

By messing with the random numbers in my code, I found that loading room 3 repeatedly can cause a problem, but the code CAN load room 3, just doing it a lot causes an error. This is why I think it might be a memory issue.

My main question is what does the error message mean? I suspect it has something to do with memory management, but I really have no idea. Also, can you guys think of a better way to store all this data?

Thanks for reading all this,
kevman323
Attachments
IsaacRemade.dsgm
(36.39 KiB) Downloaded 105 times
kevman323
 
Posts: 26
Joined: January 14th, 2013, 2:11 am

Re: Undefined opcode

Postby nicklausw » January 8th, 2014, 8:48 am

All right, I tried your ROM, and you have confirmation that it isn't just you; I consecutively received all your errors.

I need to look more into this...will try tomorrow.
my stuff
pong - sms/gb
sudoku - sega master system

next project - something for the nes, perhaps?[/b]
User avatar
nicklausw
 
Posts: 1036
Joined: May 23rd, 2011, 10:25 pm
Location: The Capital Wasteland

Re: Undefined opcode

Postby kevman323 » January 8th, 2014, 9:33 pm

I don't think this is the issue. Before "roomType[currentRoomX][currentRoomY-1]" I have "if currentRoomY>0", so that statement should not execute unless the values are within the valid range. Also, if I set the room generator to ONLY use room 1, it works 100% of the time,regardless of which rooms are being generated, but there are not specific rooms that cause this error.

The weird thing is on my previous version of this project, I had 48 arrays, 1 for each room, formatted as array[50][3], and it worked perfectly, but I should have pretty close to the same amount of variables in this new version, just in a different format.
kevman323
 
Posts: 26
Joined: January 14th, 2013, 2:11 am

Re: Undefined opcode

Postby kevman323 » January 9th, 2014, 2:14 am

I solved the problem by declaring the two string variables, AString and LineString, in the global variables section of DSGM instead of in the code. I have no idea why it works now, but I guess DSGM handles a global string variable and "dim AString as string" differently.

I am not concerned about loading times, since the floor will be created at the start of each level, but I will look into implementing your solution if I need to change it in the future.

Thanks for all of your help
kevman323
 
Posts: 26
Joined: January 14th, 2013, 2:11 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron