mirror of
https://github.com/colby-swandale/waterfoul
synced 2024-12-26 21:58:54 +01:00
Avoid allocations in MMU#[]
This commit is contained in:
parent
e774ff97be
commit
8bdd6941ad
1 changed files with 4 additions and 4 deletions
|
@ -32,12 +32,12 @@ module Waterfoul
|
|||
|
||||
if i == 0xFF00
|
||||
Input.read_keyboard @memory[i]
|
||||
elsif (0x8000...0xA000) === i or (0xC000...0xE000) === i or (0xFE00..0xFFFF) === i
|
||||
elsif i >= 0x8000 && i < 0xA000 or i >= 0xC000 && i < 0xE000 or i >= 0xFE00
|
||||
@memory[i]
|
||||
elsif (0xE000...0xFE00) === i
|
||||
@memory[i - 0x2000]
|
||||
elsif (0x0000...0x8000) === i or (0xA000...0xC000) === i
|
||||
elsif i < 0x8000 or i >= 0xA000 && i < 0xC000
|
||||
@cartridge[i]
|
||||
else # if (0xE000...0xFE00) === i
|
||||
@memory[i - 0x2000]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue