NAME=sega megadrive rom info
FILE=bins/smd/LiquidSpaceDodgerV3.bin
CMDS=i~!fd
EXPECT=<<EOF
file     bins/smd/LiquidSpaceDodgerV3.bin
size     0x272f8
humansz  156.7K
mode     r-x
format   smd
iorw     false
block    0x100
type     ROM
arch     m68k
baddr    0x0
binsz    160504
bits     16
canary   false
retguard false
class    SEGA MEGASIS    (C)2015 James L.
crypto   false
endian   big
havecode true
laddr    0x0
linenum  false
lsyms    false
machine  Sega Megadrive
nx       false
os       smd
pic      false
relocs   false
sanitiz  false
static   true
stripped false
va       true
EOF
RUN

NAME=sega megadrive rom symbols
FILE=bins/smd/LiquidSpaceDodgerV3.bin
CMDS=isq
EXPECT=<<EOF
0x00000000 0 rom_start
0x000272f8 0 rom_end
0x00ff0000 0 ram_start
0x00ffffff 0 ram_end
0x00fffff0 0 SSP
0x00000200 0 Reset
0x00001300 0 BusErr
0x0000130c 0 AdrErr
0x000012a0 0 InvOpCode
0x000012ac 0 DivBy0
0x000012b8 0 Check
0x000012c4 0 TrapV
0x000012d0 0 GPF
0x000012dc 0 Trace
0x000012e8 0 Reserv0
0x000012f4 0 Reserv1
0x00001294 0 Reserv2
0x444f4e27 0 Reserv3
0x54204c4f 0 Reserv4
0x4f4b2041 0 BadInt
0x54205448 0 Reserv10
0x49532100 0 Reserv11
0x00001294 0 Reserv12
0x00001294 0 Reserv13
0x00001294 0 Reserv14
0x00001294 0 Reserv15
0x00001294 0 Reserv16
0x00001294 0 Reserv17
0x00001294 0 BadIRQ
0x00001294 0 IRQ1
0x00001294 0 EXT
0x00001294 0 IRQ3
0x00000bb2 0 HBLANK
0x00001294 0 IRQ5
0x00000bb8 0 VBLANK
0x00001294 0 IRQ7
0x00001294 0 Trap0
0x00001294 0 Trap1
0x00001294 0 Trap2
0x00001294 0 Trap3
0x00001294 0 Trap4
0x00001294 0 Trap5
0x00001294 0 Trap6
0x00001294 0 Trap7
0x00001294 0 Trap8
0x00001294 0 Trap9
0x00001294 0 Trap10
0x00001294 0 Trap11
0x00001294 0 Trap12
0x00001294 0 Trap13
0x00001294 0 Trap14
0x00001294 0 Trap15
0x00001294 0 Reserv30
0x00001294 0 Reserv31
0x00001294 0 Reserv32
0x00001294 0 Reserv33
0x00001294 0 Reserv34
0x00001294 0 Reserv35
0x00001294 0 Reserv36
0x00001294 0 Reserv37
0x00001294 0 Reserv38
0x00001294 0 Reserv39
0x00001294 0 Reserv3A
0x00001294 0 Reserv3B
0x00001294 0 Reserv3C
0x00001294 0 Reserv3D
0x00001294 0 Reserv3E
0x00001294 0 Reserv3F
EOF
RUN

NAME=sega megadrive rom entrypoint
FILE=bins/smd/LiquidSpaceDodgerV3.bin
CMDS=ie~vadd
EXPECT=<<EOF
vaddr=0x00000200 paddr=0x00000200 haddr=-1 type=program
EOF
RUN

NAME=sega megadrive rom maps and printing
FILE=bins/smd/LiquidSpaceDodgerV3.bin
CMDS=pxw 4 @ 0x10100
EXPECT=<<EOF
0x00010100  0x00537413                                   .St.
EOF
RUN

NAME=smd strings
FILE=malloc://256k
CMDS=<<EOF
. scripts/smd_strings.rz
e bin.str.filter=U
izz
EOF
EXPECT=<<EOF
[Strings]
nth paddr      vaddr      len size section type  string
-------------------------------------------------------
0   0x00000100 0x00000100 160 161          ascii SEGA GENESIS    (C)SEGA 1995.MARCART. BRADESCO                                  CART. BRADESCO                                  GM 00000001-00W`J               
6   0x00007974 0x00007974 24  25           ascii AT&FV0B0+FCLASS=1;+FF=1\r
7   0x00007ad9 0x00007ad9 15  16           ascii NMEMORIA CHEIA.
8   0x00007ae9 0x00007ae9 13  14           ascii SEM PORTADORA
9   0x00007af7 0x00007af7 27  28           ascii INICIANDO TESTE AGUARDE !!!
10  0x00007b13 0x00007b13 13  14           ascii LINHA OCUPADA
11  0x00007b21 0x00007b21 10  11           ascii NAO ATENDE
12  0x00007b2c 0x00007b2c 16  17           ascii SEM TOM DISCAGEM
13  0x00007b3d 0x00007b3d 18  19           ascii DISCANDO NOVAMENTE
14  0x00007b50 0x00007b50 12  13           ascii CONEXAO OK !
15  0x00007b5d 0x00007b5d 13  14           ascii OPER ABORTADA
16  0x00007b6b 0x00007b6b 19  20           ascii ERRO NOVA TENTATIVA
17  0x00007b7f 0x00007b7f 19  20           ascii LINHA DESCONECTADA.
18  0x00007ba3 0x00007ba3 19  20           ascii ERRO DE COMUNICACAO
19  0x00007bb7 0x00007bb7 16  17           ascii DADOS INCORRETOS
20  0x00007bc8 0x00007bc8 17  18           ascii ENVIANDO DADOS...
21  0x00007bda 0x00007bda 15  16           ascii RECEBENDO DADOS
22  0x00007bea 0x00007bea 18  19           ascii FALHA 3 TENTATIVAS
23  0x00007bfd 0x00007bfd 19  20           ascii ERRO NOVA TENTATIVA
24  0x00007c11 0x00007c11 13  14           ascii TIMEOUT DADOS
25  0x00007c1f 0x00007c1f 14  15           ascii FINAL RECEPCAO
26  0x00007c33 0x00007c33 16  17           ascii ERRO DE CHECKSUM
27  0x00007c44 0x00007c44 18  19           ascii TRANSACAO INEXISTE
28  0x00007c57 0x00007c57 23  24           ascii DATA,HIST.,DOCTO,VALOR,
29  0x00007c74 0x00007c74 15  16           ascii SALDO VINCULADO
30  0x00007c8d 0x00007c8d 45  46           ascii SALDO DISPONIVEL,SALDO VINCULADO,SALDO TOTAL,
31  0x00007ccd 0x00007ccd 14  15           ascii  ERRO CLASS 1 
33  0x00007cf3 0x00007cf3 15  16           ascii SALDO ATUAL    
34  0x00007d03 0x00007d03 64  65           ascii DATA,SALDO TOTAL,DATA,SALDO VINCULADO,DATA,SALDO C/L PROGRAMADO,
35  0x00007d44 0x00007d44 20  21           ascii FALHA DE COMUNICACAO
36  0x00007d59 0x00007d59 15  16           ascii HOST INOPERANTE
37  0x00007d69 0x00007d69 13  14           ascii TIMEOUT  HOST
38  0x00007d77 0x00007d77 19  20           ascii ERRO DE COMUNICACAO
39  0x00007d8b 0x00007d8b 18  19           ascii AGENCIA FORA DO AR
40  0x00007d9e 0x00007d9e 21  22           ascii TRANSMISSAO CANCELADA
41  0x00007db4 0x00007db4 17  18           ascii SENHA NAO GRAVADA
42  0x00007dc6 0x00007dc6 14  15           ascii SENHA INVALIDA
43  0x00007dd5 0x00007dd5 13  14           ascii C/C BLOQUEADA
44  0x00007de3 0x00007de3 22  23           ascii EXTRATO NAO ENCONTRADO
45  0x00007dfa 0x00007dfa 15  16           ascii SEM LANCAMENTOS
46  0x00007e0a 0x00007e0a 26  27           ascii DIA DE VENCIMENTO INVALIDO
47  0x00007e25 0x00007e25 23  24           ascii MES DO EXTRATO INVALIDO
48  0x00007e3d 0x00007e3d 14  15           ascii FIM DE EXTRATO
49  0x00007e4c 0x00007e4c 17  18           ascii AGENCIA INCORRETA
50  0x00007e5e 0x00007e5e 23  24           ascii CADASTRO EM ATUALIZACAO
51  0x00007e76 0x00007e76 17  18           ascii CONTA INEXISTENTE
52  0x00007e88 0x00007e88 19  20           ascii EXTRATO INEXISTENTE
53  0x00007eaa 0x00007eaa 17  18           ascii CARTAO DE CREDITO
54  0x00007ebc 0x00007ebc 19  20           ascii LANCAMENTOS FUTUROS
55  0x00007ed0 0x00007ed0 24  25           ascii LANCAMENTOS DIA ANTERIOR
56  0x00007ee9 0x00007ee9 14  15           ascii  F.A.F.  FACIL
57  0x00007ef8 0x00007ef8 12  13           ascii AT+FCLASS=1\r
58  0x00007f23 0x00007f23 10  11           ascii AT+FTM=48\r
59  0x00007f2e 0x00007f2e 10  11           ascii AT+FTM=24\r
60  0x00007f39 0x00007f39 10  11           ascii AT+FRM=48\r
61  0x00007f44 0x00007f44 10  11           ascii AT+FRM=24\r
62  0x00007f4f 0x00007f4f 12  13           ascii DIS FRAME OK
63  0x00007f5c 0x00007f5c 13  14           ascii ERRO RX FRAME
64  0x00007f8a 0x00007f8a 14  15           ascii WAIT DIS FRAME
65  0x00007f99 0x00007f99 14  15           ascii ERRO:FRAME DIS
66  0x00007fa8 0x00007fa8 10  11           ascii ERRO FTH=3
67  0x00007fbc 0x00007fbc 17  18           ascii <TCF> TRAINING...
68  0x00007fd4 0x00007fd4 11  12           ascii RECEPCAO...
69  0x0000803b 0x0000803b 12  13           ascii ERRO PROG RX
70  0x00008048 0x00008048 18  19           ascii RECEBENDO DADOS...
71  0x0000806a 0x0000806a 16  17           ascii TRAINING 4800...
72  0x0000807b 0x0000807b 16  17           ascii TRAINING 2400...
73  0x0000808c 0x0000808c 11  12           ascii TRAINING OK
74  0x00008098 0x00008098 13  14           ascii ERRO TRAINING
75  0x000080c8 0x000080c8 17  18           ascii FALHA:COMUNICACAO
76  0x000080f8 0x000080f8 10  11           ascii ERRO BLOCO
77  0x00008103 0x00008103 25  26           ascii CONTA OU DIGITO INCORRETO
78  0x0000811d 0x0000811d 27  28           ascii CODIGO DA AGENCIA INCORRETO
79  0x00008139 0x00008139 35  36           ascii DATA DO CARTAO DE CREDITO INCORRETA
80  0x0000818c 0x0000818c 52  53           ascii 001002003005010011004020021022030031999040041042043N
87  0x0000a9bf 0x0000a9bf 12  13           ascii IJKLMNOPQRST
123 0x0000dfff 0x0000dfff 43  44           ascii >?@ABCDEFGHIJKLMNOPQQRSTULKJIHGFEDCBA@?>VWX
126 0x0000e2ba 0x0000e2ba 11  12           ascii CDEFGHIJKL*
127 0x0000e2ce 0x0000e2ce 11  12           ascii MNOPQORSPT*
132 0x0000e44d 0x0000e44d 21  22           ascii AB,CDEFGHIJKLMNOPQRST
133 0x0000e463 0x0000e463 14  15           ascii QUVWXWYZ[\]^_R
141 0x0000e723 0x0000e723 12  13           ascii #QRSTUVWRXYZ
143 0x0000e8b8 0x0000e8b8 15  16           ascii 6789:;<=>?@ABCD
152 0x0000ef10 0x0000ef10 12  13           ascii >?@>ABCDEF@G
153 0x0000ef1e 0x0000ef1e 12  13           ascii HIJKLJMNOPQR
154 0x0000ef2c 0x0000ef2c 12  13           ascii STUVWUXYZ[\]
170 0x000166ae 0x000166ae 16  17           ascii SUSU355355S53553
171 0x00016947 0x00016947 13  14           ascii 5S5S3UU355U53
172 0x00016963 0x00016963 10  11           ascii U3UU5SS3S3
200 0x00017d0e 0x00017d0e 14  15           ascii DEAQDEATDEATDE
243 0x000194cc 0x000194cc 14  15           ascii DEAQDEATDEATDE
283 0x0001acde 0x0001acde 14  15           ascii DEAQDEATDEATDE
325 0x0001c542 0x0001c542 14  15           ascii DEAQDEATDEATDE
369 0x0001d8aa 0x0001d8aa 12  13           ascii DDEQTDDEUUUU
394 0x0002036c 0x0002036c 63  64           ascii 3331333333333333DDDADDDADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDADDDADDD
EOF
RUN
