         switch (@controllRegister & 0x0C) >>> 2
             when 3 then @romBankRegister & 0x0F # Selected 16K ROM bank
             when 2 then 0                       # First 16K ROM bank
-            else        @romBankSelect & 0x0E   # Selected 32K ROM bank (first half)
+            else        @romBankRegister & 0x0E # Selected 32K ROM bank (first half)
 
     getUpperROMBank: ->
         switch (@controllRegister & 0x0C) >>> 2
-            when 3 then (@rom.length >>> 14) - 1    # Last 16K ROM bank
-            when 2 then @romBankRegister & 0x0F     # Selected 16K ROM bank
-            else        (@romBankSelect & 0x0E) + 1 # Selected 32K ROM bank (second half)
+            when 3 then (@rom.length >>> 14) - 1      # Last 16K ROM bank
+            when 2 then @romBankRegister & 0x0F       # Selected 16K ROM bank
+            else        (@romBankRegister & 0x0E) + 1 # Selected 32K ROM bank (second half)
 
     switchVROMBanks: ->
         @lowerVROMBankBase = @getLowerVROMBank() * 0x1000 # 4K $0000-$0FFF


    getLowerVROMBank: ->
        if @controllRegister & 0x10
            (@vromBankRegister1 & 0x0F) # Selected 4K VROM bank
        else
            (@vromBankRegister1 & 0x0E) # Selected 8K VROM bank (first half)

    getUpperVROMBank: ->
        if @controllRegister & 0x10
            (@vromBankRegister2 & 0x0F)     # Selected 4K VROM bank
        else
            (@vromBankRegister1 & 0x0E) + 1 # Selected 8K VROM bank (second half)

    ###########################################################
    # ROM reading

    ###########################################################

    readVROM: (address) ->
        @vrom[@$getVROMBase(address) | @$getVROMOffset(address)]

    getVROMBase: (address) ->
        if address < 0x1000
