Advertisement
Chiddix

ROM

Apr 6th, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public final class ROM {
  2.  
  3.     /**
  4.      * Gets the ROM size of the cartridge.
  5.      * @param opcode The size opcode.
  6.      * @return The ROM size of the cartridge.
  7.      */
  8.     private int getSize(final byte opcode) {
  9.         if (opcode < 8) {
  10.             return (32 * 1024) << opcode;
  11.         } else if (opcode == 52) {
  12.             return 1179648;
  13.         } else if (opcode == 53) {
  14.             return 1310720;
  15.         } else if (opcode == 54) {
  16.             return 1572864;
  17.         }
  18.         System.err.println("Unknown ROM size");
  19.         return -1;
  20.     }
  21.  
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement