Jump to content

Glossary: Difference between revisions

m
Text replacement - "~" to "–"
>Bbbbbbbbba
(Added memory corruption.)
m (Text replacement - "~" to "–")
Line 49:
-->
;{{Anchor|Memory bank}}'''Memory bank'''
:In the GameBoy, a segment of the ROM or the SRAM, mapped to a consecutive segment of the 16-bit GameBoy address space. With the exception of ROM bank 0 (the "home bank"), the banks are "switchable", i.e. they share the same address space ($4000~4000–$7FFF for switchable ROM banks, $A000~A000–$BFFF for SRAM banks), and are "switched" into and out of the accessible memory space with special instructions (technically, an "impossible write" to the ROM). This is to solve the problem that the space needed for those areas in a large game can be much larger than the 64KB that the 16-bit address space allows.
 
;{{Anchor|Memory corruption}}'''Memory corruption'''
Line 56:
 
;{{Anchor|Overflow}}'''Overflow'''
:1. For a value to exceed the range of its data type. For example, the range for an unsigned [[byte]] is 0~2550–255, so trying to calculate 100+200 would result in an overflow. If the condition is not checked, then the value would usually be "wrapped around" to an in-range value: The above example would give 300-256 = 44. Depending on the exact definition, may or may not include [[#Underflow|underflow]].
:2. See [[#Buffer overflow|buffer overflow]].
 
Line 84:
 
;{{Anchor|Underflow}}'''Underflow'''
:For a value to be lower than the minimum representable value in its data type. For example, the range for an unsigned [[byte]] is 0~2550–255, so trying to calculate 0-1 would result in an underflow. If the condition is not checked, then the value would usually be "wrapped around" to an in-range value: The above example would give (-1)+256 = 255. May or may not be considered a type of [[#Overflow|overflow]] depending on the exact definition of the latter.
:A notable example of underflow in Pokémon games is [[item underflow]], which refers to underflowing the [[#Item count|item count]] to 255, allowing the player to access an [[expanded item pack]].
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.