[Maintenance] Clean up the confusion between "tiles" and .STD tile sections

Funded by -Tom-.
This commit is contained in:
nmlgc 2018-12-30 02:28:00 +01:00
parent 75763ccd32
commit 612beb815b
5 changed files with 22 additions and 24 deletions

View File

@ -28,8 +28,8 @@ std_load proc near
call file_read pascal, es, si, [bp+@@std_size]
call file_close
mov es, _std_seg
mov _tile_index, 4
mov _tile_row, 0
mov _tile_section, 4
mov _tile_row_in_section, 0
mov al, [bp+@@chunk_size]
mov ah, 0
add si, ax

View File

@ -1,6 +1,3 @@
; Each tile defines a 384×80 section of the background, which internally are
; further divided into 5 rows of 16 pixels each.
; No idea why ZUN just didn't go with the actually visible space of 384
; horizontal tiles. That's 8 wasted tiles per row that the game doesn't do
; anything with?
@ -18,15 +15,16 @@ _halftiles_dirty_end label byte
public _tile_ring
_tile_ring dw (TILES_MEMORY_X * TILES_Y) dup(?)
; .STD files reference 384×80 (25×5) sections of tiles.
if GAME eq 5
public _tile_index_ptr
_tile_index_ptr dw ?
public _tile_section_ptr
_tile_section_ptr dw ?
else
public _tile_index
_tile_index dw ?
public _tile_section
_tile_section dw ?
endif
public _tile_row, _tile_scrollspeed_ptr
_tile_row db ?
public _tile_row_in_section, _tile_scrollspeed_ptr
_tile_row_in_section db ?
db ?
_tile_scrollspeed_ptr dw ?

View File

@ -1503,10 +1503,10 @@ loc_B84B:
mov word_25100, ax
mov bx, _std_seg
mov es, bx
dec _tile_row
dec _tile_row_in_section
jns short loc_B89D
mov _tile_row, 4
inc _tile_index
mov _tile_row_in_section, 4
inc _tile_section
inc _tile_scrollspeed_ptr
mov bx, _tile_scrollspeed_ptr
mov dl, es:[bx]
@ -1526,9 +1526,9 @@ loc_B89D:
add ax, offset _tile_ring
mov di, ax
xor ax, ax
mov al, _tile_row
mov al, _tile_row_in_section
shl ax, 6
mov bx, _tile_index
mov bx, _tile_section
mov bl, es:[bx]
xor bh, bh
add bl, bl

View File

@ -55,8 +55,8 @@ std_load proc near
mov word ptr _boss_bgm_title, di
repne scasb
lea ax, [di+5]
mov _tile_index_ptr, ax
mov _tile_row, 0
mov _tile_section_ptr, ax
mov _tile_row_in_section, 0
movzx ax, byte ptr es:[di]
inc ax
add di, ax

View File

@ -1783,7 +1783,7 @@ sub_BB9A proc near
push di
push si
push ds
mov bx, _tile_index_ptr
mov bx, _tile_section_ptr
sub bx, 4
mov di, offset _tile_ring
add di, TILES_MEMORY_X * (TILES_Y - 1) * 2
@ -1942,10 +1942,10 @@ loc_BD36:
mov bx, _std_seg
mov es, bx
assume es:nothing
dec _tile_row
dec _tile_row_in_section
jns short loc_BD88
mov _tile_row, 4
inc _tile_index_ptr
mov _tile_row_in_section, 4
inc _tile_section_ptr
inc _tile_scrollspeed_ptr
mov bx, _tile_scrollspeed_ptr
mov dl, es:[bx]
@ -1965,9 +1965,9 @@ loc_BD88:
add ax, offset _tile_ring
mov di, ax
xor ax, ax
mov al, _tile_row
mov al, _tile_row_in_section
shl ax, 6
mov bx, _tile_index_ptr
mov bx, _tile_section_ptr
mov bl, es:[bx]
xor bh, bh
mov bx, [bx+870h]