; Outch Noter text ripper
; 1997 (c) Tom et Jerry du GPA
ORG &CA30
write "loader.bin"
nolist
JP main
JP jumper
; convert datas
; -------------
; table de conversion
char_5f db &5f
char_5e db &5e
start_text equ &0280
end_text equ &78 ; text end always in &7800 - 1
new_text equ &0040 ; zone de stockage du texte decode
buf_text equ &a000 ; traitement de 40 caracteres
nb_chars_line equ 40 ; largeur d'un ecran
; load datas
; ----------
file_long db &c
file_load db "A:TURBOASS.ENG"
aff_mes LD A,(HL)
CP &D
JR Z,aff_me1
PUSH HL
CALL &BB5A
POP HL
INC HL
JR aff_mes
aff_me1 CALL &BB5A
LD A,&A
CALL &BB5A
RET
; Load Outch Noter file
load LD HL,mes_load
CALL aff_mes
LD HL,file_load
LD DE,&C000
LD A,(file_long)
LD B,A
CALL &BC77
JR NC,load_1
EX DE,HL
CALL &BC83
JR NC,load_1
CALL &BC7A
JR NC,load_1
LD A,&FF
RET
load_1 LD HL,mes_load_failed
CALL aff_mes
XOR A
RET
; Try to unpack Outch noter file
unpack LD HL,&1C5 ; adresse de saut du prog une fois decrunche
LD A,(HL)
CP &20
JR NZ,unpac_1
INC HL
LD A,(HL)
CP &78
JR Z,unpac_2
unpac_1 LD HL,mes_unpack_failed
CALL aff_mes
XOR A
RET
unpac_2 LD (HL),&CA ; on detourne le prog
DEC HL
LD (HL),&33
CALL &186 ; on lance le decrunchage
jumper LD A,&FF
JP main_2
mes_load db &f,&3,"->",&f,&1," Loading file...",&D
mes_load_failed db &f,&2,&E1,&f,&1," Loading error...",&D
mes_unpack_failed db &f,&2,&E1,&f,&1," I can't unpack this file... Use the Hacker method.",&D
mes_end db &f,&3,"->",&f,&1," Sorry old boy, press a key to reset.",&D
main call load
AND A
JR Z,main_1
call unpack
main_2 AND A
JR Z,main_1
LD HL,&D230 ; On copie en ram la deuxieme partie du ripper pour
LD DE,&9000 ; extraire le texte
LD BC,&800
LDIR
JP &9000
main_1 LD HL,mes_end
CALL aff_mes
CALL &BB18
RST &0
A,(HL)
CP &20
JR NZ,unpac_1
INC HL
LD A,(HL)
CP &78
JR Z,unpac_2
unpac_1 LD HL,mes_unpack_failed
CALL aff_mes
XOR A
RET
unpac_2 LD (HL),&CA ; on detourne le prog
DEC HL
LD (HL),&33
CALL &186 ; on lance le decrunchage
jumper LD A,&FF
JP main_2
mes_load db &f,&3,"->",&f,&1," Loading file...",&D
mes_load_failed db &f,&2,&E1,&f,&1," Loading error...",&D
mes_unpack_failed db &f,&2,&E1,&f,&1," I can't unpack this file... Use the Hacker method.",&D
mes_end db &f,&3,"->",&f,&1," Sorry old boy, press a key to reset.",&D
main call load
AND A
JR Z,main_1
call unpack
main_2 AND A
JR