![]() |
Routines |
| Prev: 49113 | Up: Map | Next: 49211 |
|
Used by the routines at ContinueAtTheNextToken and CheckObjectVisibility.
Handles calculating a time-period code for scheduling events.
|
||||||||||||||||||||
| GetTimePeriod | 49164 | LD A,(40930) | Fetch *Messaging_AM_PM. | |||||||||||||||||
| 49167 | CP 97 | Check if its "A" for AM. | ||||||||||||||||||
| 49169 | LD A,(40928) | Read the hour. | ||||||||||||||||||
| 49172 | JR Z,TimePeriod_AM | Go to TimePeriod_AM if the period letter is 97 (morning). | ||||||||||||||||||
|
It's the afternoon (as in, "PM").
|
||||||||||||||||||||
| 49174 | CP 12 | Go to TimePeriod_Morning if the hour is twelve (noon). | ||||||||||||||||||
| 49176 | JR Z,TimePeriod_Morning | |||||||||||||||||||
| 49178 | CP 8 | Go to TimePeriod_BeforeEightPM if the hour is before eight. | ||||||||||||||||||
| 49180 | JR C,TimePeriod_BeforeEightPM | |||||||||||||||||||
|
It's late PM/ evening; 8 PM - 11 PM.
|
||||||||||||||||||||
| TimePeriod_LateEvening | 49182 | LD A,1 | Leave 1 as the result. | |||||||||||||||||
| 49184 | RET | Return. | ||||||||||||||||||
|
Seven in the evening leaves time-of-day code 2.
It's before 8 PM, but break this down further.
|
||||||||||||||||||||
| TimePeriod_BeforeEightPM | 49185 | CP 7 | Go to TimePeriod_Afternoon unless the hour is seven. | |||||||||||||||||
| 49187 | JR NZ,TimePeriod_Afternoon | |||||||||||||||||||
|
It's 7 PM.
|
||||||||||||||||||||
| 49189 | LD A,2 | Leave 2 as the result. | ||||||||||||||||||
| 49191 | RET | Return. | ||||||||||||||||||
|
The afternoon, from one until six, leaves time-of-day code 3.
It's afternoon/ early PM; 1 PM - 6 PM.
|
||||||||||||||||||||
| TimePeriod_Afternoon | 49192 | LD A,3 | Leave 3 as the result. | |||||||||||||||||
| 49194 | RET | Return. | ||||||||||||||||||
|
The morning checks leave time-of-day code 4, or continue into early morning.
It's morning, but break this down further.
|
||||||||||||||||||||
| TimePeriod_AM | 49195 | CP 12 | Go to TimePeriod_LateEvening if the hour is twelve. | |||||||||||||||||
| 49197 | JR Z,TimePeriod_LateEvening | |||||||||||||||||||
| 49199 | CP 6 | Go to TimePeriod_LateEvening if the hour is before six. | ||||||||||||||||||
| 49201 | JR C,TimePeriod_LateEvening | |||||||||||||||||||
| 49203 | JR Z,TimePeriod_EarlyMorning | Go to TimePeriod_EarlyMorning if the hour is six. | ||||||||||||||||||
|
It's morning; 7 AM - noon (12 PM).
|
||||||||||||||||||||
| TimePeriod_Morning | 49205 | LD A,4 | Leave 4 as the result. | |||||||||||||||||
| 49207 | RET | Return. | ||||||||||||||||||
|
Six in the morning leaves time-of-day code 5.
It's early morning; 6 AM.
|
||||||||||||||||||||
| TimePeriod_EarlyMorning | 49208 | LD A,5 | Leave 5 as the result. | |||||||||||||||||
| 49210 | RET | Return. | ||||||||||||||||||
| Prev: 49113 | Up: Map | Next: 49211 |