Added Checksum/Header Name/Rom type information.

This commit is contained in:
zsknight
2001-05-09 08:31:34 +00:00
parent a7970f69d6
commit 117cbfd46c
2 changed files with 134 additions and 25 deletions

View File

@@ -1652,7 +1652,75 @@ SECTION .text
rep stosb rep stosb
%endmacro %endmacro
NEWSYM CSStatus, db ' TYPE: CHSUM:OK ',0
NEWSYM init65816 NEWSYM init65816
mov esi,[romdata]
add esi,7FC0h
cmp byte[romtype],2
jne .nohiromrn
add esi,8000h
.nohiromrn
mov edi,CSStatus
mov ecx,20
.looprn
mov al,[esi]
or al,al
jnz .okaysp
mov al,32
.okaysp
mov [edi],al
inc esi
inc edi
loop .looprn
mov dword[CSStatus+25],'NRM '
cmp byte[SA1Enable],0
je .nosa1
mov dword[CSStatus+25],'SA1 '
.nosa1
cmp byte[RTCEnable],0
je .nortc
mov dword[CSStatus+25],'RTC '
.nortc
cmp byte[SPC7110Enable],0
je .nospc7110
mov dword[CSStatus+25],'SP7 '
.nospc7110
cmp byte[SFXEnable],0
je .nosfx
mov dword[CSStatus+25],'SFX '
.nosfx
cmp byte[C4Enable],0
je .noc4
mov dword[CSStatus+25],'C4 '
.noc4
cmp byte[DSP1Type],0
je .nodsp1
mov dword[CSStatus+25],'DSP '
.nodsp1
cmp byte[SDD1Enable],0
je .nosdd1
mov dword[CSStatus+25],'SDD '
.nosdd1
mov ax,[Checksumvalue]
mov esi,[romdata]
add esi,7FDCh+2
cmp byte[romtype],2
jne .nohirom3
add esi,8000h
.nohirom3
cmp ax,[esi]
jne .failed
mov dword[CSStatus+36],'OK '
jmp .passed
.failed
mov dword[CSStatus+36],'FAIL'
.passed
mov dword[Msgptr],CSStatus
mov eax,[MsgCount]
mov [MessageOn],eax
mov byte[osm2dis],0 mov byte[osm2dis],0
mov byte[bgfixer2],0 mov byte[bgfixer2],0
mov word[ScrDispl],0 mov word[ScrDispl],0
@@ -3562,7 +3630,7 @@ NEWSYM loadfile
mov ecx,65536 mov ecx,65536
mov edx,[sram] mov edx,[sram]
call Read_File call Read_File
jc .failed jc near .failed
call Close_File call Close_File
jc .failed jc .failed
.notexist .notexist
@@ -3570,18 +3638,32 @@ NEWSYM loadfile
mov edx,.opened mov edx,.opened
mov ah,9 mov ah,9
call Output_Text call Output_Text
; Verify checksum
mov ecx,[.curfileofs] ; calculate checksum
mov esi,[headdata] mov eax,1
.nextcr
add eax,eax
cmp eax,[.curfileofs]
jb .nextcr
mov ecx,eax
mov esi,[romdata]
xor eax,eax xor eax,eax
xor ebx,ebx xor ebx,ebx
xor edi,edi
mov edx,ecx
shr edx,1
.nextcs .nextcs
mov al,[esi] mov al,[esi+edi]
inc esi inc edi
add ebx,eax add ebx,eax
cmp edi,[.curfileofs]
jne .notcrs
mov edi,edx
.notcrs
dec ecx dec ecx
jnz .nextcs jnz .nextcs
mov [Checksumvalue],bx mov [Checksumvalue],bx
mov eax,[.curfileofs] mov eax,[.curfileofs]
mov [NumofBytes],eax mov [NumofBytes],eax
shr eax,15 shr eax,15
@@ -4291,6 +4373,33 @@ NEWSYM loadfileGUI
jne .nextmir jne .nextmir
.nomir .nomir
; calculate checksum
mov eax,1
.nextcr
add eax,eax
cmp eax,[.curromspace]
jb .nextcr
mov ecx,eax
mov esi,[romdata]
xor eax,eax
xor ebx,ebx
xor edi,edi
mov edx,ecx
shr edx,1
.nextcs
mov al,[esi+edi]
inc edi
add ebx,eax
cmp edi,[.curromspace]
jne .notcrs
mov edi,edx
.notcrs
dec ecx
jnz .nextcs
mov [Checksumvalue],bx
cmp byte[ZipSupport],1 cmp byte[ZipSupport],1
jne .nottempdirdel jne .nottempdirdel
call PatchIPS call PatchIPS
@@ -4330,18 +4439,6 @@ NEWSYM loadfileGUI
shr eax,15 shr eax,15
mov [NumofBanks],eax mov [NumofBanks],eax
; calculate checksum
mov ecx,[.curfileofs]
mov esi,[headdata]
xor eax,eax
xor ebx,ebx
.nextcs
mov al,[esi]
inc esi
add ebx,eax
dec ecx
jnz .nextcs
mov [Checksumvalue],bx
mov eax,[.curfileofs] mov eax,[.curfileofs]
shr eax,15 shr eax,15
mov [NumofBanks],eax mov [NumofBanks],eax
@@ -4822,7 +4919,7 @@ NEWSYM showinfo
;FFBD (0=none, 1=16kbit, 3=64kbit, 5=256kbit,etc. ;FFBD (0=none, 1=16kbit, 3=64kbit, 5=256kbit,etc.
mov edx,.checksumc mov edx,.checksumc
mov ah,9 mov ah,9
; call Output_Text call Output_Text
mov ax,[Checksumvalue] mov ax,[Checksumvalue]
mov esi,[headdata] mov esi,[headdata]
add esi,7FDCh+2 add esi,7FDCh+2
@@ -4838,7 +4935,7 @@ NEWSYM showinfo
mov edx,.cfailed mov edx,.cfailed
.passed .passed
mov ah,9 mov ah,9
; call Output_Text call Output_Text
; Display NMI & Reset ; Display NMI & Reset
mov edx,.nmidisp mov edx,.nmidisp
mov ah,9 mov ah,9

View File

@@ -58,7 +58,7 @@ EXTSYM ClearScreen
EXTSYM Mode7HiRes,mosenng,mosszng,intrlng,mode7hr ;,VESAAddr EXTSYM Mode7HiRes,mosenng,mosszng,intrlng,mode7hr ;,VESAAddr
EXTSYM GUICPC, newgfx16b EXTSYM GUICPC, newgfx16b
EXTSYM vesa2_clbitng,vesa2_clbitng2,vesa2_clbitng3 EXTSYM vesa2_clbitng,vesa2_clbitng2,vesa2_clbitng3
EXTSYM granadd EXTSYM granadd,CSStatus
EXTSYM SpecialLine EXTSYM SpecialLine
EXTSYM vidbufferofsb EXTSYM vidbufferofsb
;EXTSYM Super2xSaI ;EXTSYM Super2xSaI
@@ -3019,22 +3019,22 @@ NEWSYM hextestoutput
EXTSYM Op14Zr,Op14Xr,Op14Yr,Op14U,Op14F,Op14L EXTSYM Op14Zr,Op14Xr,Op14Yr,Op14U,Op14F,Op14L
EXTSYM Op02CX,Op02CY,bg1scrolx,bg1scroly EXTSYM Op02CX,Op02CY,bg1scrolx,bg1scroly
EXTSYM TValDebug,TValDebug2,curhdma EXTSYM TValDebug,TValDebug2,curhdma
mov al,[curhdma] mov al,[scaddset]
call outputhex call outputhex
mov esi,216*288+32+16 mov esi,216*288+32+16
add esi,[vidbuffer] add esi,[vidbuffer]
xor eax,eax xor eax,eax
mov al,[TValDebug] mov al,[scaddtype]
call outputhex call outputhex
mov esi,216*288+70 mov esi,216*288+70
add esi,[vidbuffer] add esi,[vidbuffer]
xor eax,eax xor eax,eax
mov al,[TValDebug2+1] mov al,[scrnon]
call outputhex call outputhex
mov esi,216*288+70+16 mov esi,216*288+70+16
add esi,[vidbuffer] add esi,[vidbuffer]
xor eax,eax xor eax,eax
mov al,[TValDebug2] mov al,[scrnon+1]
call outputhex call outputhex
mov esi,216*288+108 mov esi,216*288+108
add esi,[vidbuffer] add esi,[vidbuffer]
@@ -3468,7 +3468,13 @@ NEWSYM copyvid
mov edi,[Msgptr] mov edi,[Msgptr]
mov esi,200*288+32 mov esi,200*288+32
add esi,[vidbuffer] add esi,[vidbuffer]
cmp edi,CSStatus
je .fivex5b
call OutputGraphicString.no16bit call OutputGraphicString.no16bit
jmp .nfivex5b
.fivex5b
call OutputGraphicString5x5
.nfivex5b
dec dword[MessageOn] dec dword[MessageOn]
jnz .nomsg jnz .nomsg
cmp byte[cbitmode],1 cmp byte[cbitmode],1
@@ -3479,7 +3485,13 @@ NEWSYM copyvid
mov edi,[Msgptr] mov edi,[Msgptr]
mov esi,200*288*2+32*2 mov esi,200*288*2+32*2
add esi,[vidbuffer] add esi,[vidbuffer]
cmp edi,CSStatus
je .fivex5
call OutputGraphicString16b call OutputGraphicString16b
jmp .nfivex5
.fivex5
call OutputGraphicString16b5x5
.nfivex5
dec dword[MessageOn] dec dword[MessageOn]
.nomsg .nomsg
jmp vidpaste jmp vidpaste