Skip to content

Commit 8df4406

Browse files
Update V3.8
1 parent b237f9f commit 8df4406

File tree

13 files changed

+1611
-471
lines changed

13 files changed

+1611
-471
lines changed

Checkmark.sprt

512 Bytes
Binary file not shown.

Data Upload Mode.pbimg

19.5 KB
Binary file not shown.

Functions.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
from framebuf import FrameBuffer,RGB565
2+
from time import sleep
3+
class Functions:
4+
def __init__(self, pgb, ttcolor, ottcolor, ic):
5+
self.pgb=pgb
6+
self.ttcolor=ttcolor
7+
self.ic=ic
8+
self.ottcolor=ottcolor
9+
10+
11+
def readchunk(self, filename, x2, y2, w, h, q=True):
12+
if x2>240:
13+
sleep(0.015)
14+
return
15+
buffersize=w*2
16+
p=240-w-x2
17+
if p<0:
18+
e=abs(240-x2)
19+
buffersize=e*2
20+
if p<0:
21+
p=abs(p)
22+
else:
23+
p=0
24+
o=0
25+
x=bytearray(p*2)
26+
27+
size=0
28+
with open(filename, "rb") as image_file:
29+
for y in range(h):
30+
existing_line_start = ((y + y2) * 240 + x2) * 2
31+
image_file.readinto(self.pgb.buffer[existing_line_start:existing_line_start + buffersize])
32+
image_file.readinto(x[0:p*2])
33+
size += image_file.tell()
34+
o+=p
35+
if not size==1742400 and q:
36+
self.pgb.fill_rect(x2,y2,w,h,self.ttcolor)
37+
unit=int((len(self.ic)/2)*12)
38+
for i,j in enumerate(self.ic):
39+
j=j.replace("\r","")
40+
self.pgb.create_text(j,x2+(60-(len(j)*4)),y2+(60-unit)+(i*12),self.ottcolor)
41+
sleep(0.01)
42+
return
43+
44+
45+
def readchunk_mask(self, filename,x2,y2,w,h,cmask=57351):
46+
with open(filename,"rb") as r:
47+
for x in range(h):
48+
tempfb=FrameBuffer(bytearray(r.read(2*w)),w,1,RGB565)
49+
self.pgb.blit(tempfb,x2,y2+x,cmask)
50+
del tempfb
51+
52+
def draw_image(self, imagedata,ts=-1):
53+
ps=int(240/len(imagedata))
54+
y=-1
55+
for i in imagedata:
56+
y+=1
57+
x=-1
58+
if not ts==-1:
59+
if ts==0:
60+
skip=True
61+
elif y in range(0,ts):
62+
skip=True
63+
else:
64+
skip=False
65+
else:
66+
skip=False
67+
if not skip:
68+
for f in i:
69+
x+=1
70+
self.pgb.fill_rect(x*ps,y*ps,ps,ps,f)
71+
sleep(0.1)
72+
73+
def getimagedata(self, bgimagefile):
74+
imagedata=[]
75+
with open(bgimagefile) as f:
76+
for i in range(30):
77+
comp=[]
78+
for x in f.readline().split(":"):
79+
comp.append(int(x))
80+
imagedata.append(comp)
81+
del comp
82+
del f
83+
return imagedata
84+
85+
86+

Intro Text.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Welcome!, This is the PicoBoy: a video/game console that makes/making games as easy as pi!, We are now going to/configure your PicoBoy/to your liking., Before we do anything,/let's test your PicoBoy's/hardware!, Press A to begin!, Test your buttons!, Press all of the/buttons to continue, Button Test Passed!, Test your sound!, (Flip the switch on the/top to the left), When you hear a sound/press the A button., Press A to begin testing., Testing channel , When you hear a sound,/press the A button., Channel , failed!, passed!, Sound test passed., Sound test failed., Check the soldering/on your sound diodes., Tests Passed!, Your PicoBoy has passed/all of its hardware tests., Now lets start configuring/your PicoBoy!, Press A to continue!, Choose a background color/using the left and right/buttons., Press A to continue., Use the left and right/buttons to change the/brightness., Press A to continue., Use the left and right/buttons to change the/volume., Press A to continue., All Done!, You are all done/setting up your PicoBoy!, Press home to continue!
2+
Bienvenido!, Este es el PicoBoy: una/videoconsola juegos que hace/que los juegos sean tan/faciles como pi!, Ahora vamos a/configurar tu PicoBoy/a tu gusto., Antes de hacer nada,/probemos tu PicoBoy/ hardware!, Presione A para comenzar!, Pruebe sus botones!, Presione todos los botones/ para continuar, Prueba de botones/aprobada!, Pruebe su sonido!, (Gire el interruptor en la/parte superior hacia/la izquierda), Cuando escuche un sonido/presione el boton A., Presione A para comenzar/la prueba., Probando canal , Cuando escuche un sonido,/presione el boton A., Canal , fallo!, paso!, Prueba de sonido paso., Prueba de sonido fallo., Verificar la soldadura/en sus diodos de sonido., Pruebas aprobadas!, Su PicoBoy ha pasado/todas sus pruebas de/hardware., Ahora comencemos a/configurar su PicoBoy!, Presione A para continuar!, Elija un color de fondo/usando la izquierda y/la derecha Botones., Presione A para continuar., Use los botones/izquierdo y derecho/para cambiar el brillo., Presione A para continuar., Use los botones/izquierdo y derecho/para cambiar el/volumen., Presione A para continuar., Todo Listo!, Ya terminaste/configuraste tu PicoBoy!, Presiona Inicio para/continuar!
3+
Bienvenue!, Voici le PicoBoy: une console/de jeu video qui rend les/jeux aussi simples que pi!, Nous allons maintenant/configurer votre PicoBoy/a votre gout., Avant de faire/quoi que ce soit,/testons votre PicoBoy/ materiel!, Appuyez sur A pour commencer!, Testez vos boutons!, Appuyez sur tous les boutons/pour continuer, Test des boutons/reussi!, Testez votre son!, (Basculez l'interrupteur/en haut vers la gauche), Lorsque vous entendez un son/appuyez sur le bouton A., Appuyez sur A pour/commencer le test., Test du canal , Lorsque vous entendez un son,/appuyez sur le bouton A., Canal , echec!, reussi!, Test sonore reussi., Test sonore echoue., Verifiez la soudure/sur vos diodes sonores., Tests reussis!, Votre PicoBoy a reussi/tous ses tests materiels., Commencons maintenant a/configurer votre PicoBoy!, Appuyez sur A pour/continuer!, Choisissez une couleur de/fond en utilisant les touches/gauche et droite boutons., Appuyez sur A pour/continuer., Utilisez les boutons gauche/et droit pour modifier/la luminosite., Appuyez sur A pour/continuer., Utilisez les boutons gauche/et droit pour modifier/le volume., Appuyez sur A pour/continuer., Tous Termine!, Vous avez termine/configure votre PicoBoy!, Appuyez sur Accueil/pour continuer!
4+
Willkommen!, Das ist der PicoBoy: eine/Spielekonsole die Spiele/ soeinfach macht wie Pi!, Wir werden jetzt Ihren/PicoBoy nach Ihren/Wunschen konfigurieren., Bevor wir etwas unternehmen,/lassen Sie uns Ihren PicoBoy/testen Hardware!, Drucken Sie A um zu/beginnen!, Testen Sie Ihre Tasten!, Drucken Sie alle Tasten/um fortzufahren, Tastentest bestanden!, Testen Sie Ihren Sound!, (Drehen Sie den Schalter/oben nach links), Wenn Sie a horen Ton/Drucken Sie die A-Taste., Drucken Sie A um mit/dem Test zu beginnen., Testen des Kanals , Wenn Sie einen Ton horen,/drucken Sie die A-Taste., Kanal , fehlgeschlagen!, Bestanden!, Tontest bestanden., Tontest fehlgeschlagen., Uberprufen das Loten/an Ihren Sounddioden., Tests bestanden!, Ihr PicoBoy hat alle seine/Hardwaretests bestanden., Jetzt beginnen wir mit der/Konfiguration Ihrem PicoBoy!, Drucken Sie A um/fortzufahren!, Wahlen Sie eine/Hintergrundfarbe mit/der linken und rechten Taste/Tasten., Drucken Sie A um/fortzufahren., Verwenden Sie die Links-/und Rechts-Tasten/um die Helligkeit zu andern., Drucken Sie A um/fortzufahren., Verwenden Sie die Links-/und Rechts-Tasten/um die Lautstarke zu andern., Drucken Sie A um/fortzufahren., Alle Fertig!, Sie sind mit der Einrichtung/Ihres PicoBoy fertig!, Drucken Sie die Home-Taste/um fortzufahren!
5+
Benvenuto!, Questo e PicoBoy: una console/per videogiochi giochi che/rende i giochi facili/come pi!, Ora configureremo il tuo/PicoBoy a tuo piacimento., Prima di fare qualsiasi cosa/testiamo il tuo PicoBoy/hardware!, Premi A per iniziare!, Prova i pulsanti!, Premi tutti i pulsanti/per continuare, Test dei pulsanti/superato!, Metti alla prova il tuo/suono!, (Sposta l'interruttore in/alto a sinistra), Quando senti un suono/premi il pulsante A., Premi A per iniziare/il test., Test del canale , Quando senti un suono,/premi il pulsante A., Canale , fallito!, superato!, Test del suono superato., Test del suono fallito., Controlla la saldatura/sui diodi sonori., Test superati!, Il tuo PicoBoy ha superato/tutti i test hardware., Ora iniziamo a configurare/il tuo PicoBoy!, Premi A per continuare!, Scegli un colore di/sfondo usando i tasti/sinistro e destro., Premere A per continuare., Utilizzare i pulsanti/sinistra e destra per/modificare la luminosita., Premere A per continuare., Utilizzare i pulsanti/sinistra e destra per/modificare il volume., Premere A per continuare., Tutto Fatto!, Hai finito configurato/il tuo PicoBoy!, Premi Home per continuare!

Main Text.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
No Games, Settings, No Image, DATA UPLOAD MODE/Plug your PicoBoy/into your computer/and run the PicoBoy/Communication Software./To exit data/upload mode reset/your PicoBoy., Game failed to start!/This game may be corrupted./Press any button to exit., Image/Corrupted
2+
No Juegos, Ajustes, Sin imagen, MODO DE CARGA DATOS/Conecta tu PicoBoy/a tu computadora/y ejecuta PicoBoy/Communication Software./Para salir de modo/de carga de datos/reinicia tu PicoBoy., El juego no pudo comenzar!/Este juego puede estar/danado. Presione cualquier/boton para salir., Imagen/corrupta
3+
Pas De Jeux, Parametres, Pas d'image, MODE AJOUTER DONNEES/Branchez votre PicoBoy/dans votre ordinateur/et lancez le PicoBoy/Communication Software./Pour quitter les donnees/ajouter la remettre du/mode donnees ton PicoBoy., Le jeu n'a pas pu demarrer!/Ce jeu est peut-etre/Appuyez sur n'importe quel/corrompu. bouton pour/quitter., Image/corrompue
4+
Keine Spiele, Einstellungen, Kein Bild, DATENHOCHLADEN-MODUS/Verbinden dein PicoBoy/zu deinem Computer/und verwenden PicoBoy/Communication Software./Daten verlassen Upload/Modus zuruckgesetzt/Dein PicoBoy., Das Spiel konnte nicht/gestartet werden!/Dieses Spiel ist/moglicherweise beschadigt./Drucken Sie eine beliebige/Taste, um den Vorgang/zu beenden., Bild/beschadigt
5+
Niente Giochi, Impostazioni, Nessuna/immagine, MODALITA AGGIUNTA DATI/Collega il tuo PicoBoy/nel tuo computer ed/eseguire il PicoBoy/Communication Software./Per uscire dai modalita/aggiunta dati ripristina/il tuo PicoBoy., Impossibile avviare/il gioco!/Questo gioco potrebbe/essere corrotto. Premere/qualsiasi pulsante per/uscire., Immagine/danneggiata

No Games.pbimg

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

PicoBoySDK.py

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,27 @@ def init_display(self):
113113

114114
def decrease_brightness(self):
115115
if self.DUTY_CYCLE > self.DUTY_CYCLE_MIN:
116-
self.DUTY_CYCLE -= 2750
116+
self.DUTY_CYCLE -= int((self.DUTY_CYCLE_MAX-self.DUTY_CYCLE_MIN)/20)
117+
if self.DUTY_CYCLE<self.DUTY_CYCLE_MIN:
118+
self.DUTY_CYCLE=self.DUTY_CYCLE_MIN
117119
self.bl.duty_u16(self.DUTY_CYCLE)
118-
with open("/brghtness.conf", "w") as w:
119-
w.write(str(self.DUTY_CYCLE))
120+
try:
121+
with open("/brghtness.conf", "w") as w:
122+
w.write(str(self.DUTY_CYCLE))
123+
except:
124+
""
120125

121126
def increase_brightness(self):
122127
if self.DUTY_CYCLE < self.DUTY_CYCLE_MAX:
123-
self.DUTY_CYCLE += 2750
128+
self.DUTY_CYCLE += int((self.DUTY_CYCLE_MAX-self.DUTY_CYCLE_MIN)/20)
129+
if self.DUTY_CYCLE>self.DUTY_CYCLE_MAX:
130+
self.DUTY_CYCLE=self.DUTY_CYCLE_MAX
124131
self.bl.duty_u16(self.DUTY_CYCLE)
125-
with open("/brghtness.conf", "w") as w:
126-
w.write(str(self.DUTY_CYCLE))
132+
try:
133+
with open("/brghtness.conf", "w") as w:
134+
w.write(str(self.DUTY_CYCLE))
135+
except:
136+
""
127137

128138
def power_off(self):
129139
pass
@@ -204,6 +214,13 @@ def __init__(self,namespace=None,tick_time=0.025):
204214
else:
205215
print(error)
206216
sys.exit()
217+
try:
218+
with open("/langauge.conf") as r:
219+
self.langauge=int(r.read())
220+
if self.langauge>4:
221+
raise
222+
except:
223+
self.langauge=0
207224
self.maskcolor=self.color(31,17,9)
208225
self.namespace=namespace
209226
self.tick=tick_time
@@ -363,11 +380,37 @@ def Update(self, savescore=None, noclear=False):
363380
vsys_voltage = adc_voltage * 3
364381
if vsys_voltage<1.9:
365382
self.fill(self.color(0,0,0))
366-
self.Create_Text("BATTERY CRITICALLY LOW!",-1,30,(255,255,255))
367-
self.Create_Text("Please replace the", -1, 130, (255,255,255))
368-
self.Create_Text("batteries in your PicoBoy.", -1, 145, (255,255,255))
369-
self.Create_Text("Please switch your", -1, 200, (255,255,255))
370-
self.Create_Text("PicoBoy off.", -1, 215, (255,255,255))
383+
print(self.langauge)
384+
if self.langauge==0:
385+
self.Create_Text("BATTERY CRITICALLY LOW!",-1,30,(255,255,255))
386+
self.Create_Text("Please replace the", -1, 130, (255,255,255))
387+
self.Create_Text("batteries in your PicoBoy.", -1, 145, (255,255,255))
388+
self.Create_Text("Please switch your", -1, 200, (255,255,255))
389+
self.Create_Text("PicoBoy off.", -1, 215, (255,255,255))
390+
if self.langauge==1:
391+
self.Create_Text("BATERIA CRITICAMENTE BAJA!",-1,30,(255,255,255))
392+
self.Create_Text("Por favor reemplace el", -1, 130, (255,255,255))
393+
self.Create_Text("baterias en su PicoBoy.", -1, 145, (255,255,255))
394+
self.Create_Text("Por favor cambia tu", -1, 200, (255,255,255))
395+
self.Create_Text("PicoBoy fuera.", -1, 215, (255,255,255))
396+
if self.langauge==2:
397+
self.Create_Text("BATTERIE CRITIQUEMENT FAIBLE!",-1,30,(255,255,255))
398+
self.Create_Text("Veuillez remplacer le", -1, 130, (255,255,255))
399+
self.Create_Text("piles dans votre PicoBoy.", -1, 145, (255,255,255))
400+
self.Create_Text("Veuillez changer votre", -1, 200, (255,255,255))
401+
self.Create_Text("PicoBoy s'en va.", -1, 215, (255,255,255))
402+
if self.langauge==3:
403+
self.Create_Text("BATTERIE KRITISCH NIEDRIG!",-1,30,(255,255,255))
404+
self.Create_Text("Bitte ersetzen Sie die", -1, 130, (255,255,255))
405+
self.Create_Text("Batterien in Ihrem PicoBoy.", -1, 145, (255,255,255))
406+
self.Create_Text("Bitte wechseln Sie Ihr", -1, 200, (255,255,255))
407+
self.Create_Text("PicoBoy aus.", -1, 215, (255,255,255))
408+
if self.langauge==4:
409+
self.Create_Text("BATTERIA CRITICAMENTE SCARICA!",-1,30,(255,255,255))
410+
self.Create_Text("Si prega di sostituire il", -1, 130, (255,255,255))
411+
self.Create_Text("batterie del tuo PicoBoy.", -1, 145, (255,255,255))
412+
self.Create_Text("Per favore, cambia il tuo", -1, 200, (255,255,255))
413+
self.Create_Text("PicoBoy spento.", -1, 215, (255,255,255))
371414
self.rect(75,60,80,40,self.color(255,0,0))
372415
self.fill_rect(155,70,10,20,self.color(255,0,0))
373416
self.line(75,60,155,99,self.color(255,0,0))

PicoGameBoy.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,44 @@ def show(self):
6464
if vsys_voltage>10:
6565
vsys_voltage = adc_voltage * 3
6666
if vsys_voltage<1.9:
67+
try:
68+
with open("langauge.conf") as r:
69+
self.langauge=int(r.read())
70+
if self.langauge>4:
71+
raise
72+
except:
73+
self.langauge=0
6774
self.fill(PicoGameBoy.color(0,0,0))
68-
self.create_text("BATTERY CRITICALLY LOW!",-1,30,PicoGameBoy.color(255,255,255))
69-
self.create_text("Please replace the", -1, 130, PicoGameBoy.color(255,255,255))
70-
self.create_text("batteries in your PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
71-
self.create_text("Please switch your", -1, 200, PicoGameBoy.color(255,255,255))
72-
self.create_text("PicoBoy off.", -1, 215, PicoGameBoy.color(255,255,255))
75+
if self.langauge==0:
76+
self.create_text("BATTERY CRITICALLY LOW!",-1,30,PicoGameBoy.color(255,255,255))
77+
self.create_text("Please replace the", -1, 130, PicoGameBoy.color(255,255,255))
78+
self.create_text("batteries in your PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
79+
self.create_text("Please switch your", -1, 200, PicoGameBoy.color(255,255,255))
80+
self.create_text("PicoBoy off.", -1, 215, PicoGameBoy.color(255,255,255))
81+
if self.langauge==1:
82+
self.create_text("BATERIA CRITICAMENTE BAJA!",-1,30,PicoGameBoy.color(255,255,255))
83+
self.create_text("Por favor reemplace el", -1, 130, PicoGameBoy.color(255,255,255))
84+
self.create_text("baterias en su PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
85+
self.create_text("Por favor cambia tu", -1, 200, PicoGameBoy.color(255,255,255))
86+
self.create_text("PicoBoy fuera.", -1, 215, PicoGameBoy.color(255,255,255))
87+
if self.langauge==2:
88+
self.create_text("BATTERIE CRITIQUEMENT FAIBLE!",-1,30,PicoGameBoy.color(255,255,255))
89+
self.create_text("Veuillez remplacer le", -1, 130, PicoGameBoy.color(255,255,255))
90+
self.create_text("piles dans votre PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
91+
self.create_text("Veuillez changer votre", -1, 200, PicoGameBoy.color(255,255,255))
92+
self.create_text("PicoBoy s'en va.", -1, 215, PicoGameBoy.color(255,255,255))
93+
if self.langauge==3:
94+
self.create_text("BATTERIE KRITISCH NIEDRIG!",-1,30,PicoGameBoy.color(255,255,255))
95+
self.create_text("Bitte ersetzen Sie die", -1, 130, PicoGameBoy.color(255,255,255))
96+
self.create_text("Batterien in Ihrem PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
97+
self.create_text("Bitte wechseln Sie Ihr", -1, 200, PicoGameBoy.color(255,255,255))
98+
self.create_text("PicoBoy aus.", -1, 215, PicoGameBoy.color(255,255,255))
99+
if self.langauge==4:
100+
self.create_text("BATTERIA CRITICAMENTE SCARICA!",-1,30,PicoGameBoy.color(255,255,255))
101+
self.create_text("Si prega di sostituire il", -1, 130, PicoGameBoy.color(255,255,255))
102+
self.create_text("batterie del tuo PicoBoy.", -1, 145, PicoGameBoy.color(255,255,255))
103+
self.create_text("Per favore, cambia il tuo", -1, 200, PicoGameBoy.color(255,255,255))
104+
self.create_text("PicoBoy spento.", -1, 215, PicoGameBoy.color(255,255,255))
73105
self.rect(75,60,80,40,PicoGameBoy.color(255,0,0))
74106
self.fill_rect(155,70,10,20,PicoGameBoy.color(255,0,0))
75107
self.line(75,60,155,99,PicoGameBoy.color(255,0,0))

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PBOS V2.6
1+
PBOS V3.0

0 commit comments

Comments
 (0)