Mal wieder ein wenig Neues.
Ich habe jetzt die Ballphysik von 8 Bit auf 9.4 Bit erweitert, also volle Aufloesung und dazu bis runter zu 1/16 pixel.
Das hakt noch ein wenig allerdings
Ausserdem muss ich mir langsam Gedanken zum Speicher machen und hab ein kleines Tool geschrieben, welches das veranschaulicht.
Das geht schoener, besser etc etc aber mein Punkt ist immer, dass ich Dinge gerne schnell und einfach in Python erledige. Dieser Post hier dauert glatt laenger als der kleine Code.
Im Quelltext des Spiels verwende ich einfach labels wie folgt:
Der Assembler (XA von Floodgap) gibt bei Bedarf folgendes in der Labelliste aus dann:
Der folgende Code liest einfach die begin_ und end_ labels aus und erstellt daraus einen 'stacked bar' chart mit labels (siehe Anhang)
und dazu wird das auch aufgelistet:
Und hier der Python code selbst (wie gesagt einfach so runtergeschrieben ohne Anspruch auf Eleganz oder so
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.ticker as ticker
- infile=open('labels.txt')
- fielddic={}
- fields=[]
- for line in infile:
- tag,adress,count,dummy=line.split(",")
- if 'begin_' in tag:
- field=tag.split("_")[1]
- location= int(adress,16)
- fielddic[tag]=location
- if field not in fields:
- fields.append(field)
- if 'end_' in tag:
- field=tag.split("_")[1]
- location= int(adress,16)
- fielddic[tag]=location
- for field in fields:
- start=fielddic['begin_%s'%field]
- end =fielddic['end_%s'%field]
- length=end-start
- print "%04x\t%04x\t%04x\t%s" % (start,end,length,field)
- if 'code' in field:
- plt.bar(0, length,bottom=start,edgecolor='white', width=1,label=field,color="black")
- else:
- plt.bar(0, length,bottom=start,edgecolor='white', width=1,label=field)
- axes = plt.gca()
- axes.get_yaxis().set_major_formatter(ticker.FormatStrFormatter("$%04x"))
- axes.get_xaxis().set_major_formatter(ticker.FormatStrFormatter(""))
- axes.legend(loc=1)
- ti=np.arange(0,0x10000,0x1000)
- plt.yticks(ti)
- plt.ylim(0,0x10000)
- plt.xlabel("")
- plt.show()
Und ja, 'framedata' ist wirklich so gross