-
Notifications
You must be signed in to change notification settings - Fork 10
SubSource Flag
Note: most likely this technique is not needed for simple games. So, it's not mandatory for jr-devs.
The SubSource
can be chosen in the Flag column of the Achievement Editor
Works similarly to Add Source
, but the Sub Source
flag makes the value in the memory address have a negative value.
Note 1: Sub Source
is NOT a subtraction flag. It just makes the value be negative.
Note 2: The final line (without Add Source
or Sub Source
) is still added for the final comparison.
Using that AddSource
usecase example, if we replaced it with the Sub Source
and with the same values (value(0x8010) = 1
and value(0x8020) = 2
), the comparison would be -1 + 2 > 0
, or 1 > 0
.
Sub Source can also be used to track specific increases in addresses. The condition below states that the current value in address 0x00cbd6
less 30
(0x1e
in hexadecimal) must be equal previous value of that same address. Effectively, this means that the condition is true whenever the value in address 0x00cbd6
increases by exactly 30.
If the result of your Sub Source operation is a negative number, it is possible to check for it. This is how negative numbers are represented:
-
-1
is0xFFFFFFFF
-
-2
is0xFFFFFFFE
-
-3
is0xFFFFFFFD
-
-4
is0xFFFFFFFC
-
-5
is0xFFFFFFFB
-
-6
is0xFFFFFFFA
-
-7
is0xFFFFFFF9
- and so on...
So, let's say you want to check if value(0x8010) = 1
minus value(0x8020) = 2
equals -1
. This is how you would do it:
This means -2 + 1 = -1
, which is true.
Advanced: it is also possible to use straight negative numbers in the left section of your Sub/Add Source operations. To do so, remember to change the Type from Mem
to Value
, and use the values as explained above, such as 0xFFFFFFE5
for -27
, and 0xFFFFFFE3
for -29
, for example:
This means -2 + (-27) = -29
, which is -2 - 27 = -29
, which is true.
Take care, though, if you use a straight negative number in a Sub Source flag, it will result in a double negative, turning the number back to positive. Take a look:
This means - (-2) + (-27) = -29
, which is 2 - 27 = -29
, which is -25 = -29
, which is false.
- User Guidelines
- Developer Guidelines
- Content Guidelines
- FAQ
- Setup Guide
- Emulator Support and Issues
- Ways to Contribute
- RABot, the RA Discord Robot
- Events
- Overlay Themes
- Useful Links
- Contributing with the docs
- About Us
- Tutorials
- Developer Docs
- How to Become an Achievement Developer
- Getting Started as an Achievement Developer
- Game Identification
- Achievement Design
- Achievement Scoring
- Difficulty Scale and Balance
- Progression and Win Condition Typing
- Badge and Icon Creation
- Achievement Development Overview
- Flags
- BitCount Size
- Alt Groups
- Hit Counts
- Delta Values
- Prior Values
- Value Definition
- Condition Syntax
- Minimum Required Versions for Logic Features
- Memory Inspector
- Real Examples
- Set Development Roadmap
- Achievement Templates
- Tips and Tricks
- Leaderboards
- Rich Presence
- RATools
- Console Specific Tips
- Emulator Hotkeys for Developers
- libretro core support
- Docs To Do List
- WIP User Code of Conduct
- WIP CoC FAQ
- WIP Content Guidelines
- WIP-Jr
- WIP---Dev-Tips---Code-Notes-En-Masse
- WIP-‐-Reauthorship-Policy
- Manifesto RetroAchievements
- Código de Conduta do Usuário
- FAQ - Perguntas Frequentes
- Como contribuir se você não é um desenvolvedor
- Tutorial para Jogos Multi-Discos
- Introdução
- Primeiros Passos como um Desenvolvedor de Conquistas
- Recursos de Lógica para Achievements
- Exemplos Reais
- Dicas e Truques
- Dicas Específicas de Console
- Modelos de Achievement
- Escala de Dificuldade e Equilíbrio
- Roteiro de Desenvolvimento de um Set de Conquistas
- Criação de Ícones e Emblemas
- Leaderboards
- Rich Presence
- Design de Conquistas
- Manifesto RetroAchievements
- Código de Conducta del Usuario
- FAQ - Preguntas Frecuentes
- Tablas Globales y Reglas para la Casería de Logros
- Mi juego no esta cargando los logros
- Como contribuir si no eres un desarrollador
- Por que no deberías utilizar la función de cargar estado
- Contribuyendo con los documentos
- Como funciona la Documentación de RA
- Descargas
- Intro
- Código de Conducta del Desarrollador
- Como convertirme en un Desarrollador de Logros
- Primeros pasos como un Desarrollador de Logros
- Un vistazo al Inspector de Memoria
- Características en la Logica de un Logro
- Ejemplos Reales
- Intro
- Utilizando Hit Counts como un Temporizador
- Utilizando Valores Delta y Hit Counts para Detectar un Incremento
- Un Ejemplo Simple en como evitar el Abuso de Estados de Guardado
- Evitar el Problema de que un Contador se Incremente Dos Veces en el Mismo Frame
- Creando un Temporizador con un ResetIf Hits basándote en la Velocidad de un Juego
- Plantillas para Logros
- Tips y Trucos
- Escala de Dificultad y Balance
- Diseño de Logros
- Mapa de Desarrollo de Set
- Revisiones en Set de Logros
- Creación de Iconos y Badges
- Tablas de Clasificación
- Rich Presence
- Trabajando con el ROM apropiado
- Identificación del Juego
- Guía para Sets Bonus
- Logros para ROM hacks
- Tips Específicos por Consola