Crystal Beans from Dungeon Explorer/Cutscene Script: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Created page)
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Overview==
{{subpage}}
 
A '''Cutscene script''' is a sequence of commands to load data and control different aspects of a cutscene. The command have not been all completely reverse-engineered but the command number and the number and size of their arguments is known. In the table below '''long''' refers to a 24-bits integer.
A '''Cutscene script''' is a sequence of commands to load data and control different aspects of a cutscene. The command have not been all completely reverse-engineered but the command number and the number and size of their arguments is known. In the table below '''long''' refers to a 24-bits integer.


Line 9: Line 10:
| '''Decompress data to VRAM'''<br>
| '''Decompress data to VRAM'''<br>
Arguments:<br>
Arguments:<br>
:'''long''': pointer to the source address of the data to be decompressed<br>
:'''long''': pointer to the source address of the data to be decompressed
:'''word''': VRAM destination address (as given to IO port $2116)<br>
:'''word''': VRAM destination address (as given to IO port $2116)
:'''word''': number of words to decompress
:'''word''': number of words to decompress
|-
|-
Line 16: Line 17:
| '''Decompress and set palette ($7FEE00)'''<br>
| '''Decompress and set palette ($7FEE00)'''<br>
Arguments:<br>
Arguments:<br>
:'''long''': pointer to the source address of the data to be decompressed<br>
:'''long''': pointer to the source address of the data to be decompressed
:'''word''': destination palette index (only the low byte is used)<br>
:'''word''': destination palette index (only the low byte is used)
:'''word''': number of words to decompress
:'''word''': number of words to decompress
|-
|-
Line 23: Line 24:
| '''Decompress data (tilemap?) to WRAM ($7F8000) and send it to VRAM?'''<br>
| '''Decompress data (tilemap?) to WRAM ($7F8000) and send it to VRAM?'''<br>
Arguments:<br>
Arguments:<br>
:'''long''': pointer to source address of the data to be decompressed<br>
:'''long''': pointer to source address of the data to be decompressed
:'''word''': number of words to decompress<br>
:'''word''': number of words to decompress
:'''word''': VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)<br>
:'''word''': VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)
:'''word''': size in words of the items to send<br>
:'''word''': size in words of the items to send
:'''word''': number of items to send<br>
:'''word''': number of items to send
:'''word''': number of bytes between items to send
:'''word''': number of bytes between items to send
|-
|-
Line 33: Line 34:
| '''Send data (tilemap?) to VRAM?'''<br>
| '''Send data (tilemap?) to VRAM?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': source data index from $7F8000<br>
:'''word''': source data index from $7F8000
:'''word''': VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)<br>
:'''word''': VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)
:'''word''': size in words of the items to send<br>
:'''word''': size in words of the items to send
:'''word''': number of items to send<br>
:'''word''': number of items to send
:'''word''': number of bytes between items to send
:'''word''': number of bytes between items to send
|-
|-
Line 56: Line 57:
| '''Set OAM data?'''<br>
| '''Set OAM data?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': pointer to [[Crystal Beans From Dungeon Explorer:Cutscene sprite data struct|OAM data struct]] (copied to [$1C5D])<br>
:'''word''': pointer to [[Crystal Beans From Dungeon Explorer:Cutscene sprite data struct|OAM data struct]] (copied to [$1C5D])
:'''word''': pointer to [[Crystal Beans From Dungeon Explorer:Cutscene sprite control|sprite control commands]] (copied to [$1B11])<br>
:'''word''': pointer to [[Crystal Beans From Dungeon Explorer:Cutscene sprite control|sprite control commands]] (copied to [$1B11])
:'''word''': copied to [$1BE9]
:'''word''': copied to [$1BE9]
|-
|-
Line 66: Line 67:
| '''Init tilemap?'''<br>
| '''Init tilemap?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': VRAM destination address (as given to IO port $2116)<br>
:'''word''': VRAM destination address (as given to IO port $2116)
:'''byte''': number of VRAM words to set<br>
:'''byte''': number of VRAM words to set
:'''byte''': copied to [$3B]
:'''byte''': copied to [$3B]
|-
|-
Line 73: Line 74:
| '''?'''<br>
| '''?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': some index (copied to register X)<br>
:'''word''': some index (copied to register X)
:'''word''': copied to [$1A08+index]<br>
:'''word''': copied to [$1A08+index]
:'''word''': copied to [$1A0E+index]
:'''word''': copied to [$1A0E+index]
|-
|-
Line 80: Line 81:
| '''?'''<br>
| '''?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': copied to [$1B59]<br>
:'''word''': copied to [$1B59]
:'''word''': copied to [$1A14]<br>
:'''word''': copied to [$1A14]
:'''word''': copied to [$1A18]<br>
:'''word''': copied to [$1A18]
:'''word''': copied to [$1B11]
:'''word''': copied to [$1B11]
|-
|-
Line 110: Line 111:
| '''?'''<br>
| '''?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': ?<br>
:'''word''': ?
:'''word''': function pointer (copied to [$1B11])<br>
:'''word''': function pointer (copied to [$1B11])
:'''word''': copied to [$1B35]
:'''word''': copied to [$1B35]
|-
|-
Line 120: Line 121:
| '''?'''<br>
| '''?'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': index from $7F8000 (source data)<br>
:'''word''': index from $7F8000 (source data)
:'''word''': copied to [$32]<br>
:'''word''': copied to [$32]
:'''word''': copied to [$38]<br>
:'''word''': copied to [$38]
:'''word''': copied to [$3B]<br>
:'''word''': copied to [$3B]
:'''word''': copied to [$38]<br>
:'''word''': copied to [$38]
:'''word''': copied to [$41]
:'''word''': copied to [$41]
|-
|-
Line 133: Line 134:
| '''Execute function'''<br>
| '''Execute function'''<br>
Arguments:<br>
Arguments:<br>
:'''word''': function pointer<br>
:'''word''': function pointer
:'''word''': function argument (copied to [$38])
:'''word''': function argument (copied to [$38])
|-
|-

Latest revision as of 21:03, 28 January 2024

This is a sub-page of Crystal Beans from Dungeon Explorer.

A Cutscene script is a sequence of commands to load data and control different aspects of a cutscene. The command have not been all completely reverse-engineered but the command number and the number and size of their arguments is known. In the table below long refers to a 24-bits integer.

Command reference

Command Description
0x00
0x01
Decompress data to VRAM

Arguments:

long: pointer to the source address of the data to be decompressed
word: VRAM destination address (as given to IO port $2116)
word: number of words to decompress
0x02
0x03
Decompress and set palette ($7FEE00)

Arguments:

long: pointer to the source address of the data to be decompressed
word: destination palette index (only the low byte is used)
word: number of words to decompress
0x04 Decompress data (tilemap?) to WRAM ($7F8000) and send it to VRAM?

Arguments:

long: pointer to source address of the data to be decompressed
word: number of words to decompress
word: VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)
word: size in words of the items to send
word: number of items to send
word: number of bytes between items to send
0x05 Send data (tilemap?) to VRAM?

Arguments:

word: source data index from $7F8000
word: VRAM destination address (as given to IO port $2116) (note: the VRAM address will increment by $20 between each item)
word: size in words of the items to send
word: number of items to send
word: number of bytes between items to send
0x06 ?

No arguments

0x07 Same as 0x06 but pause execution
0x08 ?

No arguments

0x09 Same as 0x08 but pause execution
0x0A Set OAM data?

Arguments:

word: pointer to OAM data struct (copied to [$1C5D])
word: pointer to sprite control commands (copied to [$1B11])
word: copied to [$1BE9]
0x0B Same as 0x0A but pause execution
0x0C
0x0D
Init tilemap?

Arguments:

word: VRAM destination address (as given to IO port $2116)
byte: number of VRAM words to set
byte: copied to [$3B]
0x0E
0x0F
?

Arguments:

word: some index (copied to register X)
word: copied to [$1A08+index]
word: copied to [$1A0E+index]
0x10 ?

Arguments:

word: copied to [$1B59]
word: copied to [$1A14]
word: copied to [$1A18]
word: copied to [$1B11]
0x11 Same as 0x10 but pause execution
0x12 ?

Arguments:

word: copied to [$1B11]
0x13 Same as 0x12 but pause execution
0x14 Delay
word: number of time units to delay (copied to [$1B11])
0x15 Same as 0x14 but pause execution
0x16
0x17
?

No arguments

0x18 ?

Arguments:

word: ?
word: function pointer (copied to [$1B11])
word: copied to [$1B35]
0x19 Same as 0x18 but pause execution
0x1A ?

Arguments:

word: index from $7F8000 (source data)
word: copied to [$32]
word: copied to [$38]
word: copied to [$3B]
word: copied to [$38]
word: copied to [$41]
0x1B Same as 0x1A but pause execution
0x1C
0x1D
Execute function

Arguments:

word: function pointer
word: function argument (copied to [$38])
0x1E
0x1F
?

Arguments:

byte: byte to send to APUIO0 (note: sent two times. The first time it's ORed with 0x80, the second time it's sent as-is)
0x20
0x21
End of script

No arguments