-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmizer.asm
119 lines (114 loc) · 2.38 KB
/
mizer.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; -------------------------------------------------------
; MSX-O-Mizer v1.5f datas depacker *ROM based version*
; Improved from Metalbrain's z80 version.
; -------------------------------------------------------
; source in hl
; dest in de
; 328 bytes which must be aligned on 8 bits boundary
mom_map_bits_rom = MSX_O_Mizer_buf
; 26 bytes located in ram
mom_offset_table = MSX_O_Mizer_buf + 328
mom_depack_rom: push de
ld bc, mom_offset_table
push bc
ld d,b
ld e,c
ld bc, 26
ldir
push hl
pop af
pop hl
push af
ld iy, mom_map_bits_rom + 0xf0
ld b, 52
mom_init_bits_rom: ld a, iyl
and 15
jr nz, mom_node_rom
ld de, 1
mom_node_rom: rrd
ld (iy), a
ld (iy + 36), e
ld (iy + 72), d
inc iyl
inc a
push hl
ld hl, 0
scf
mom_set_bit_rom: adc hl, hl
dec a
jr nz, mom_set_bit_rom
add hl, de
ex de, hl
pop hl
bit 0, b
jr z, mom_wait_step_rom
inc hl
mom_wait_step_rom: djnz mom_init_bits_rom
pop hl
ld a, (hl)
inc hl
ld ixh, a
pop de
mom_lit_copy_rom: ldi
mom_main_loop_rom: call mom_get_bit_rom
jr c, mom_lit_copy_rom
ld c, -17
mom_get_index_rom: call mom_get_bit_rom
inc c
jr nc, mom_get_index_rom
ld a, c
ret z
push de
call mom_get_pair_rom
push bc
jr nz, mom_out_range_rom
ld de, 0x0220
dec c
jr z, mom_go_for_it_rom
ld de, 0x0410
dec c
jr z, mom_go_for_it_rom
mom_out_range_rom: ld de, 0x0400
mom_go_for_it_rom: pop af
ex af, af'
call mom_get_bits_rom
add a, e
call mom_get_pair_rom
pop de
push hl
ld h, d
ld l, e
sbc hl, bc
ex af, af'
push af
pop bc
ldir
pop hl
jr mom_main_loop_rom
mom_get_pair_rom: ld iyl, a
ld d, (iy)
call mom_get_bits_rom
add (iy + 36)
ld c, a
ld a, b
adc (iy + 72)
ld b, a
ret
mom_get_bits_rom: ld bc, 0
mom_getting_bits_rom:
dec d
ld a, c
ret m
call mom_get_bit_rom
rl c
rl b
jr mom_getting_bits_rom
mom_get_bit_rom: ld a, ixh
add a
jr nz, mom_byte_done_rom
ld a, (hl)
inc hl
rla
mom_byte_done_rom: ld ixh, a
ret