Changes

Jump to navigation Jump to search

FF7/Field/Script/Opcodes/38 STTIM

2,020 bytes added, 04:15, 8 September 2006
no edit summary
* Opcode: '''0x38'''
* Short name: '''STTIM'''
* Long name: Set Timer

==== Memory layout ====
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0x38
! width="50" | ''B1 / B2''
! width="50" | ''0 / B3''
! width="40" | ''H''
! width="40" | ''M''
! width="40" | ''S''
|}

==== Arguments ====

* '''const Bit[4]''' ''B1'': Bank to find hours value, or zero if hours (''B1'') is passed as a value.
* '''const Bit[4]''' ''B2'': Bank to find minutes value, or zero if minutes (''B2'') is passed as a value.
* '''const Bit[4]''' ''0'': Zero.
* '''const Bit[4]''' ''B3'': Bank to find seconds value, or zero if seconds (''B3'') is passed as a value.
* '''const UByte''' ''H'': Hours, or address to find hours value, if ''B1'' is non-zero.
* '''const UByte''' ''M'': Minutes, or address to find minutes value, if ''B2'' is non-zero.
* '''const UByte''' ''S'': Seconds, or address to find seconds value, if ''B3'' is non-zero.

==== Description ====

Sets the clock, as found in the [[FF7/Field/Script/Opcodes/36 WSPCL|WSPCL]] opcode.

If the hours, minutes or seconds are specified in the argument, the corresponding ''B'' nybble is zero. Otherwise, the value for the time component is retrieved from the bank and address specified. The seperate time components can be retrieved from memory or specified as a value, in the same argument list, as demonstrated below.

==== Example ====

The following example sets the clock to 67:34 using literal values for hours, and retrieved values for minutes and seconds.

SETBYTE(50,12,7) // Bank 5, Address 0x12: 7 minutes
SETBYTE(50,14,22) // Bank 5, Address 0x14: 34 seconds
STTIM(5,5,1,12,14) // One hour, retrieved vals for minutes/seconds
WINDOW(0,20,20,75,75) // Set up a window
WSPCL(0,1,5,5) // Set the window to a timer type
WMODE(0,2,1) // Transparent, non-closable window
MESSAGE(0,1) // Display the window & timer

Navigation menu