mirror of
https://github.com/irmen/prog8.git
synced 2024-09-16 16:55:50 +00:00
textelite
This commit is contained in:
parent
8bb3b3be20
commit
94c30fc21e
@ -5,16 +5,31 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
|
|
||||||
str name
|
sub start() {
|
||||||
|
|
||||||
|
repeat 0 {
|
||||||
struct Planet {
|
txt.print("repeat0\n")
|
||||||
ubyte x
|
|
||||||
ubyte y
|
|
||||||
str name = "????????"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub start() {
|
repeat 2 {
|
||||||
|
txt.print("repeat2\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
ubyte u=3
|
||||||
|
|
||||||
|
repeat u-1 {
|
||||||
|
txt.print("repeat u=2\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
u=2
|
||||||
|
repeat u-1 {
|
||||||
|
txt.print("repeat u=1\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
u=1
|
||||||
|
repeat u-1 {
|
||||||
|
txt.print("repeat u=0\n")
|
||||||
|
}
|
||||||
|
|
||||||
txt.chrout('\n')
|
txt.chrout('\n')
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,8 @@ main {
|
|||||||
txt.print("\nstart!!!!")
|
txt.print("\nstart!!!!")
|
||||||
galaxy.debug_seed()
|
galaxy.debug_seed()
|
||||||
|
|
||||||
;lgalaxy.generate_planet(galaxy.numforLave)
|
galaxy.generate_planet(galaxy.numforLave)
|
||||||
galaxy.generate_planet(0)
|
planet.display(false)
|
||||||
planet.display(true)
|
|
||||||
|
|
||||||
; repeat 5 {
|
; repeat 5 {
|
||||||
; planet.set_seed(rndw(), rndw())
|
; planet.set_seed(rndw(), rndw())
|
||||||
@ -64,7 +63,7 @@ galaxy {
|
|||||||
seed[1] = base1
|
seed[1] = base1
|
||||||
seed[2] = base2
|
seed[2] = base2
|
||||||
|
|
||||||
repeat galaxynum-1 { ; TODO fix repeat(0)
|
repeat galaxynum-1 {
|
||||||
nextgalaxy()
|
nextgalaxy()
|
||||||
}
|
}
|
||||||
; planets are now created procedurally on the fly.
|
; planets are now created procedurally on the fly.
|
||||||
@ -130,17 +129,45 @@ galaxy {
|
|||||||
txt.print_ub(pair4)
|
txt.print_ub(pair4)
|
||||||
txt.chrout('\n')
|
txt.chrout('\n')
|
||||||
|
|
||||||
ubyte longnameflag = lsb(seed[0]) & 64
|
ubyte ni = 0
|
||||||
; namechars = [self.pairs[pair1],
|
if pairs[pair1] != '.' {
|
||||||
; self.pairs[pair1 + 1],
|
planet.name[ni] = pairs[pair1]
|
||||||
; self.pairs[pair2],
|
ni++
|
||||||
; self.pairs[pair2 + 1],
|
}
|
||||||
; self.pairs[pair3],
|
if pairs[pair1+1] != '.' {
|
||||||
; self.pairs[pair3 + 1]]
|
planet.name[ni] = pairs[pair1+1]
|
||||||
; if longnameflag: # bit 6 of ORIGINAL w0 flags a four-pair name
|
ni++
|
||||||
; namechars.append(self.pairs[pair4])
|
}
|
||||||
; namechars.append(self.pairs[pair4 + 1])
|
if pairs[pair2] != '.' {
|
||||||
; thissys.name = "".join(namechars).replace(".", "")
|
planet.name[ni] = pairs[pair2]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
if pairs[pair2+1] != '.' {
|
||||||
|
planet.name[ni] = pairs[pair2+1]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
if pairs[pair3] != '.' {
|
||||||
|
planet.name[ni] = pairs[pair3]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
if pairs[pair3+1] != '.' {
|
||||||
|
planet.name[ni] = pairs[pair1+3]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
|
||||||
|
if lsb(seed[0]) & 64 {
|
||||||
|
; long name
|
||||||
|
if pairs[pair4] != '.' {
|
||||||
|
planet.name[ni] = pairs[pair4]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
if pairs[pair4+1] != '.' {
|
||||||
|
planet.name[ni] = pairs[pair4+1]
|
||||||
|
ni++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
planet.name[ni] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
sub tweakseed() {
|
sub tweakseed() {
|
||||||
@ -356,7 +383,7 @@ planet {
|
|||||||
|
|
||||||
sub display(ubyte compressed) {
|
sub display(ubyte compressed) {
|
||||||
if compressed {
|
if compressed {
|
||||||
txt.print(name)
|
print_name_uppercase()
|
||||||
txt.print(" TL:")
|
txt.print(" TL:")
|
||||||
txt.print_ub(techlevel+1)
|
txt.print_ub(techlevel+1)
|
||||||
txt.chrout(' ')
|
txt.chrout(' ')
|
||||||
@ -365,7 +392,7 @@ planet {
|
|||||||
txt.print(govnames[govtype])
|
txt.print(govnames[govtype])
|
||||||
} else {
|
} else {
|
||||||
txt.print("\n\nSystem: ")
|
txt.print("\n\nSystem: ")
|
||||||
txt.print(name)
|
print_name_uppercase()
|
||||||
txt.print("\nPosition: ")
|
txt.print("\nPosition: ")
|
||||||
txt.print_ub(x)
|
txt.print_ub(x)
|
||||||
txt.chrout(',')
|
txt.chrout(',')
|
||||||
@ -388,6 +415,12 @@ planet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub print_name_uppercase() {
|
||||||
|
ubyte c
|
||||||
|
for c in name
|
||||||
|
txt.chrout(c | 32)
|
||||||
|
}
|
||||||
|
|
||||||
asmsub getword(ubyte list @A, ubyte wordidx @Y) -> uword @AY {
|
asmsub getword(ubyte list @A, ubyte wordidx @Y) -> uword @AY {
|
||||||
%asm {{
|
%asm {{
|
||||||
sty P8ZP_SCRATCH_REG
|
sty P8ZP_SCRATCH_REG
|
||||||
|
Loading…
Reference in New Issue
Block a user