brunodea / gebemula

Emulator for GameBoy written in Rust.
10 stars 1 forks source link

Use consts file for constants. #4

Open brunodea opened 8 years ago

brunodea commented 8 years ago

Instead of using match mem[0x147], I believe we should use a constant for that address, so that it is easier to understand what it refers to, e.g., match mem[consts::CARTRIDGE_TYPE].

Not only in the memory code, but wherever looks appropriate.

I've created two files for this purpose, cpu/consts.rs and mem/consts.rs. So, the consts should be added in one or the other according to their meaning.