Adicionei a fonte original do Spectrum a um dictionary no ParadiseCafe.py

Mais dados documentados
This commit is contained in:
Pedro de Oliveira 2013-06-03 02:13:03 +01:00
parent 8b03c85a1c
commit cac5736a67
6 changed files with 239 additions and 57 deletions

View File

@ -1,59 +1,42 @@
b $4000 screen$
D $4000 #UDGTABLE { #SCR(loading) | Ecrã de entrada - screen$. } TABLE#
b $5B00 System variables (?)
b $5CB6 Channel infomation (?)
b $5CCB Program data (Basic?)
;b $5CD5
;t $5CF4 AVISO AO PUBLICO
;b $5D0B
;t $5D22 Contem cenas
;b $5D39
;t $5D4E eventualmente chocantes
;b $5D6F
;t $5D94
;b $5D97
;t $5DC6
;b $5DCB #HTML[#UDG$53AB,2(5dcb)]
;t $5E1B
;b $5E20
;t $5E3F DAMATTA
;b $5E46
b $5E27 Basic stacks (novo)
c $7530 Inicio do codigo(?)
c $75CF
b $75E2
t $76F3
b $76F6
t $772A
b $7736
t $77D1 THE END
b $77E3
D $4000,$1b00 #UDGTABLE { #SCR(loading) | Ecrã de entrada - screen$. } TABLE#
c $77F2 Inicializa variaveis
;b $5B00 System variables (?)
;b $5CB6 Channel infomation (?)
b $5CCB Program data (Basic?)
$5CCB,$15c
;b $5E27 Basic stacks (novo)
c $7530 Game over(?)
c $75CF
b $75E2 Prisão
$75E2 #HTML[#CALL:decode_data($8970,$75E2)]
b $7799 Canhola - Frame 1
$7799 #HTML[#CALL:decode_data($8C30,$7799)]
b $77B6 Canhola - Frame 2
$77B6 #HTML[#CALL:decode_data($8C30,$77B6)]
b $77D5 The End
$77D5 #HTML[#CALL:decode_data($3C00,$77D5)]
z $77E4
c $77EA Inicio do codigo!
$7854,2 Começa-se sem arma
$787D,3 Guarda o valor do FRAMES (contador de tempo +-)
$7880,2 Subtrai $80
$7882,8 Corre o "randomizer" o numero de vezes que estiver em A
b $788D
t $78AC
b $78C7
t $78D7
b $78DB
t $78F0
b $78F3
t $7938
b $793B
t $7970
b $7973
t $797C
b $797F
t $7988
b $798B
t $79BC
b $79BF
t $79D6 Recordista do jogo
b $79E8
b $788D Ecrã de entrada - Recordista do jogo - BY DAMATTA
$788D #HTML[#CALL:decode_data($3C00,$788D)]
z $79EA
c $7CF0
c $7D2B Delay(?)
@ -107,10 +90,21 @@ b $87D8
c $8800
z $88FF
c $8900
t $89A6 DAMATTA
b $89AD
t $89DC NOVO RECORDE / Introduza o seu nome / Esta correcto o seu nome
b $8A27
b $89D2 Novo record - Introduza o seu nome .
$89D2 #HTML[#CALL:decode_data($3C00,$89D2)]
b $8A09 Esta correcto o seu nome ?
$8A09 #HTML[#CALL:decode_data($3C00,$8A09)]
b $8A29 Duas linhas pretas (?)
$8A29 #HTML[#CALL:decode_data($3C00,$8A29)]
b $8A70
t $8CD2
b $8CE0
t $8CFC

View File

@ -9,8 +9,106 @@ from .skoolhtml import HtmlWriter, Udg
class ParadiseCafeHtmlWriter(HtmlWriter):
font = {
'20': [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ],
'21': [ 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, ],
'22': [ 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, ],
'23': [ 0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00, ],
'24': [ 0x00, 0x08, 0x3E, 0x28, 0x3E, 0x0A, 0x3E, 0x08, ],
'25': [ 0x00, 0x62, 0x64, 0x08, 0x10, 0x26, 0x46, 0x00, ],
'26': [ 0x00, 0x10, 0x28, 0x10, 0x2A, 0x44, 0x3A, 0x00, ],
'27': [ 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, ],
'28': [ 0x00, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x00, ],
'29': [ 0x00, 0x20, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, ],
'2A': [ 0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00, ],
'2B': [ 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, ],
'2C': [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, ],
'2D': [ 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, ],
'2E': [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, ],
'2F': [ 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, ],
'30': [ 0x00, 0x3C, 0x46, 0x4A, 0x52, 0x62, 0x3C, 0x00, ],
'31': [ 0x00, 0x18, 0x28, 0x08, 0x08, 0x08, 0x3E, 0x00, ],
'32': [ 0x00, 0x3C, 0x42, 0x02, 0x3C, 0x40, 0x7E, 0x00, ],
'33': [ 0x00, 0x3C, 0x42, 0x0C, 0x02, 0x42, 0x3C, 0x00, ],
'34': [ 0x00, 0x08, 0x18, 0x28, 0x48, 0x7E, 0x08, 0x00, ],
'35': [ 0x00, 0x7E, 0x40, 0x7C, 0x02, 0x42, 0x3C, 0x00, ],
'36': [ 0x00, 0x3C, 0x40, 0x7C, 0x42, 0x42, 0x3C, 0x00, ],
'37': [ 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x10, 0x00, ],
'38': [ 0x00, 0x3C, 0x42, 0x3C, 0x42, 0x42, 0x3C, 0x00, ],
'39': [ 0x00, 0x3C, 0x42, 0x42, 0x3E, 0x02, 0x3C, 0x00, ],
'3A': [ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, ],
'3B': [ 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, ],
'3C': [ 0x00, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00, ],
'3D': [ 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, ],
'3E': [ 0x00, 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00, ],
'3F': [ 0x00, 0x3C, 0x42, 0x04, 0x08, 0x00, 0x08, 0x00, ],
'40': [ 0x00, 0x3C, 0x4A, 0x56, 0x5E, 0x40, 0x3C, 0x00, ],
'41': [ 0x00, 0x3C, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00, ],
'42': [ 0x00, 0x7C, 0x42, 0x7C, 0x42, 0x42, 0x7C, 0x00, ],
'43': [ 0x00, 0x3C, 0x42, 0x40, 0x40, 0x42, 0x3C, 0x00, ],
'44': [ 0x00, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x00, ],
'45': [ 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, ],
'46': [ 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, ],
'47': [ 0x00, 0x3C, 0x42, 0x40, 0x4E, 0x42, 0x3C, 0x00, ],
'48': [ 0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x00, ],
'49': [ 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, ],
'4A': [ 0x00, 0x02, 0x02, 0x02, 0x42, 0x42, 0x3C, 0x00, ],
'4B': [ 0x00, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, ],
'4C': [ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, ],
'4D': [ 0x00, 0x42, 0x66, 0x5A, 0x42, 0x42, 0x42, 0x00, ],
'4E': [ 0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00, ],
'4F': [ 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, ],
'50': [ 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x00, ],
'51': [ 0x00, 0x3C, 0x42, 0x42, 0x52, 0x4A, 0x3C, 0x00, ],
'52': [ 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x44, 0x42, 0x00, ],
'53': [ 0x00, 0x3C, 0x40, 0x3C, 0x02, 0x42, 0x3C, 0x00, ],
'54': [ 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, ],
'55': [ 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, ],
'56': [ 0x00, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, ],
'57': [ 0x00, 0x42, 0x42, 0x42, 0x42, 0x5A, 0x24, 0x00, ],
'58': [ 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00, ],
'59': [ 0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x00, ],
'5A': [ 0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, ],
'5B': [ 0x00, 0x0E, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00, ],
'5C': [ 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, ],
'5D': [ 0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, ],
'5E': [ 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x00, ],
'5F': [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, ],
'60': [ 0x00, 0x1C, 0x22, 0x78, 0x20, 0x20, 0x7E, 0x00, ],
'61': [ 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, ],
'62': [ 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x3C, 0x00, ],
'63': [ 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, ],
'64': [ 0x00, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3C, 0x00, ],
'65': [ 0x00, 0x00, 0x38, 0x44, 0x78, 0x40, 0x3C, 0x00, ],
'66': [ 0x00, 0x0C, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00, ],
'67': [ 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x38, ],
'68': [ 0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x00, ],
'69': [ 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00, ],
'6A': [ 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x24, 0x18, ],
'6B': [ 0x00, 0x20, 0x28, 0x30, 0x30, 0x28, 0x24, 0x00, ],
'6C': [ 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, ],
'6D': [ 0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00, ],
'6E': [ 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00, ],
'6F': [ 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, ],
'70': [ 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, ],
'71': [ 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x06, ],
'72': [ 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x20, 0x00, ],
'73': [ 0x00, 0x00, 0x38, 0x40, 0x38, 0x04, 0x78, 0x00, ],
'74': [ 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x0C, 0x00, ],
'75': [ 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, ],
'76': [ 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, ],
'77': [ 0x00, 0x00, 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, ],
'78': [ 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, ],
'79': [ 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, ],
'7A': [ 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, ],
'7B': [ 0x00, 0x0E, 0x08, 0x30, 0x08, 0x08, 0x0E, 0x00, ],
'7C': [ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, ],
'7D': [ 0x00, 0x70, 0x10, 0x0C, 0x10, 0x10, 0x70, 0x00, ],
'7E': [ 0x00, 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, ],
'7F': [ 0x3C, 0x42, 0x99, 0xA1, 0xA1, 0x99, 0x42, 0x3C, ],
}
def init(self):
self.font = {}
pass
def hello_world(self, cwd):
@ -22,6 +120,10 @@ class ParadiseCafeHtmlWriter(HtmlWriter):
if char == 0x80:
blockbytes = [0, 0, 0, 0, 0, 0, 0, 0]
elif char == 0x81:
blockbytes = [0xf, 0xf, 0xf, 0xf, 0x0, 0x0, 0x0, 0x0]
elif char == 0x82:
blockbytes = [0xf0, 0xf0, 0xf0, 0xf0, 0x0, 0x0, 0x0, 0x0]
elif char == 0x85:
blockbytes = [0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf]
elif char == 0x8A:
@ -93,12 +195,14 @@ class ParadiseCafeHtmlWriter(HtmlWriter):
ink = 0
# fundo
paper = 0
flash = 0
brightness = 0
# encher o array com o caracter SPACE
zbr = 0x3D00 # endereço do chr$ space na memoria
for i in range(24):
for j in range(32):
udg_array[i][j] = Udg(7, self.snapshot[zbr:zbr+8])
udg_array[i][j] = Udg(63, self.snapshot[zbr:zbr+8])
addr = dataaddr
while self.snapshot[addr] != 0xFF:
@ -118,12 +222,16 @@ class ParadiseCafeHtmlWriter(HtmlWriter):
paper = self.snapshot[addr+1]
addr += 2
continue
if self.snapshot[addr] == 0x12:
flash = self.snapshot[addr+1]
addr += 2
continue
v = (self.snapshot[addr] - 0x20)
ad = ( chraddr + 256 ) + v * 8
attr = 0
attr = ink | (paper << 3) | attr << 6
attr = ink | (paper << 3) | (brightness << 6) | (flash << 7)
# BLOCK CHARS
if (self.snapshot[addr] >= 0x80 and self.snapshot[addr] <= 0x8f):
@ -134,7 +242,13 @@ class ParadiseCafeHtmlWriter(HtmlWriter):
ad = ( 0xFF58 ) + (v*8)
udg_array[x][y] = Udg(ad, self.snapshot[ad:ad+8])
else:
udg_array[x][y] = Udg(attr, self.snapshot[ad:ad+8])
if (chraddr == 0x3C00):
#ad = ( 0x3C00 + 256) + v * 8
#udg_array[x][y] = Udg(attr, self.snapshot[ad:ad+8])
key = "%02X" % (self.snapshot[addr])
udg_array[x][y] = Udg(attr, self.font[key])
else:
udg_array[x][y] = Udg(attr, self.snapshot[ad:ad+8])
y += 1
addr += 1

BIN
extra/font.bin Normal file

Binary file not shown.

18
extra/font_gen.py Normal file
View File

@ -0,0 +1,18 @@
import pprint
primeira_letra = 0x20
ultima_letra = 0x7F
font = {}
letra = primeira_letra
file = open("font.bin", 'rb')
print "font = {"
while letra <= ultima_letra:
bytes = file.read(8)
print "\t'%02X': [" % (letra),
for b in bytes:
print "0x%02X, " % (ord(b)),
print "], "
letra += 1
print "}"

23
extra/puta_gen_B5C9.py Normal file
View File

@ -0,0 +1,23 @@
chars=0xc8e0
d = 0x02
e = 0x0a
c = 0x0f
while c != 0:
a = 0x16
print "%02X" % (a),
a = d
print "%02X" % (a),
a = e
print "%02X" % (a),
b = 0x05
while b != 0:
a = 0x80
print "%02X" % (a),
b -= 1
d += 1
c -= 1

33
extra/puta_gen_B914.py Normal file
View File

@ -0,0 +1,33 @@
chars=0xc8e0
d = 0x02
e = 0x0f
c = 0x04
while c != 0:
a = 0x16
print "%02X" % (a),
a = d
print "%02X" % (a),
a = e
print "%02X" % (a)
a = 0x11
print "%02X" % (a),
a = 0x01
print "%02X" % (a)
a = 0x80
print "%02X" % (a)
a = 0x11
print "%02X" % (a),
a = 0x02
print "%02X" % (a)
b = 0x06
while b != 0:
a = 0x80
print "%02X" % (a)
b -= 1
d += 1
c -= 1