Monday, January 18, 2010

105/b05

Mentioned early macros 105/b05 are used for (probably) simple data copy
from one mem location to another. No idea (yet) if teh data is chanegd after read/before write.

- 105:
trigger 0105 - unk 0006,fffb
0180,02e0,00a0

Seems to be reading two WORDS from mem address stored at $4c0 and copy to mem location defined in $4c2

- b05:
trigger 0b05 - unk 0006,ffdb
0180,02e0,00a0,0182,02e0,00c0

Looks like extended version of 105. It's operating on 4 WORDS (address
in $4c0) and copies some (all?) of the data to address defined in $4c2 and $4c4.

4 WORDS = counter, 0, data1, data2

Here's some dasm code from zero team with comments:

mov ax,0h
mov [4A0h],ax
mov [4A2h],ax
mov [4A4h],ax
mov [4A6h],ax COP writes, unknown

mov di,0C000h data tables area
mov [di],ax
mov [di+2h],ax
mov [4C6h],di start of tabele address -> COP
mov bx,640h offset of COP crt/video area
mov word ptr [bx+56h],0A9h 696 ?
mov word ptr [bx+5Ch],5h 69c ?
mov word ptr [bx+52h],0A9h 692 ?
mov word ptr [bx+5Ah],140h 69a ?
mov word ptr [di+4h],0F000h f000->c004
mov word ptr [di+6h],0h 0000->c006

mov word ptr [4C0h],0C004h macro arg 1 = src offset
mov word ptr [4C2h],6A0h macro arg 2 = address in cop ram, where to write data
mov word ptr [500h],105h MACRO 105 CALL (copies data from oen address to another?)
mov word ptr [di+4h],0h 0000->c004
mov word ptr [di+6h],8000h 8000->c006
mov word ptr [4C0h],0C004h macro arg 1 = src offset
mov word ptr [4C2h],6ACh macro arg 2 = address in cop ram, where to write data
mov word ptr [500h],105h MACRO 105 CALL
mov si,di
add si,830h offset of the _SECOND_ (40h ) tab
mov word ptr [4C2h],6B8h 2nd arg? dest address
mov [4C0h],si 1st arg = offset of the table
mov word ptr [500h],105h 105 command
add si,4h sizeof(WORD*2) -> macro is operating on two 16 bit (word) data pointe dby the arg 1

mov cx,40h num of entries in table
mov word ptr [4C2h],6BCh dest 1
mov word ptr [4C4h],6B4h dest 2

loop1:
mov [4C0h],si arg = address in mem
mov word ptr [500h],0B05h macro b05
add si,8h add size of table _entry_ ( num, 0, data, data)
loop loop10F0685h

mov si,di
add si,30h start of 1st table
mov cx,100h 100 entries
mov word ptr [4C2h],6BCh same as above
mov word ptr [4C4h],6B0h different
loop2:
mov [4C0h],si address
mov word ptr [500h],0B05h macro b05
add si,8h next entry
loop loop20F06A8h

mov si,di
add si,20h points to prepared data (encryption keys?)
mov cx,4h
mov word ptr [4C2h],6A8h
loop3:
mov [4C0h],si
mov word ptr [500h],105h
add si,4h
loop loop30F06C5h

mov si,di
add si,8h
mov cx,6h
mov word ptr [4C2h],6A4h dest address
loop4:
mov [4C0h],si src address
mov word ptr [500h],105h
add si,4h
loop loop40F06E2h
mov word ptr [di+4h],0h
mov word ptr [di+6h],0h
mov word ptr [4C0h],0C004h src address
mov word ptr [4C2h],6ACh dest address
mov word ptr [500h],105h simple copy ?

mov ax,1000h
mov [470h],ax gfx bank related ? somethign with screen flipping
nop
nop
nop
mov ax,0h
mov [470h],ax

mov cx,51Ah
xor ax,ax
rep stosw

No comments:

Post a Comment