diff --git a/th04/formats/std.asm b/th04/formats/std.asm index a6eff858..3766e739 100644 --- a/th04/formats/std.asm +++ b/th04/formats/std.asm @@ -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 diff --git a/th04/tiles[bss].asm b/th04/tiles[bss].asm index ca97465a..23f4e876 100644 --- a/th04/tiles[bss].asm +++ b/th04/tiles[bss].asm @@ -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 ? diff --git a/th04_main.asm b/th04_main.asm index 93aa2965..a09dde61 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -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 diff --git a/th05/formats/std.asm b/th05/formats/std.asm index 936d0e1e..8fed5fa4 100644 --- a/th05/formats/std.asm +++ b/th05/formats/std.asm @@ -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 diff --git a/th05_main.asm b/th05_main.asm index 0e129313..cc319003 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -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]