madiali / mips-emulator

Other
3 stars 1 forks source link

Index out of bounds error[BUG] #20

Closed emmagoodrich closed 1 year ago

emmagoodrich commented 1 year ago

Tasks

Description

Asked to report by Montek - getting Index Out of Bounds error when trying to load .json file image

Reproduction steps

  1. Go to terminal
  2. run 'mips-em' (not sure if you want my .mem files)

Expected behavior

Emulator to start running. I did not change anything in the .json file, and all my .mem file names match what is in the file.

Screenshots

No response

Logs

No response

OS

macOS

Additional context

No response

jesse-wei commented 1 year ago

Please paste your JSON file here, I'll check it out

jesse-wei commented 1 year ago

Are you using 32x32 (i.e., not 16x16) sprites? Sprites that aren't 16x16 aren't supported.

The exception that occurs is in VGADisplayBMPController, which controls the screen, and the error you're getting is related to the screen.

Specifically, I'm seeing "index 300 out of bounds for size 300", and 300 px is the height of the VGA display. Your code should only be attempting to access index 299 at most but is attempting to access 300, for some reason.

Since execution didn't get past the initialize method, it might be your smem file. How many lines are in each of your mem files?

jesse-wei commented 1 year ago

Emma is using 32x32 sprites, which is not supported.