junglejourney
changeset 8:47ba7035d5ba
Added character images and started to write sprite routines for them.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Sun Aug 07 20:35:37 2011 +0200 |
| parents | c6c8b87ee2fe |
| children | bdf8ef70ed44 |
| files | build.py images/left1.xpm images/left2.xpm images/right1.xpm images/right2.xpm makesprites.py mapcode.oph |
| diffstat | 7 files changed, 219 insertions(+), 21 deletions(-) [+] |
line diff
1.1 --- a/build.py Sun Aug 07 19:27:49 2011 +0200 1.2 +++ b/build.py Sun Aug 07 20:35:37 2011 +0200 1.3 @@ -46,6 +46,15 @@ 1.4 1.5 out_uef_file = sys.argv[1] 1.6 1.7 + # Planned memory map 1.8 + # 1900 CODE (map) 1.9 + # 1x00 space 1.10 + # 5000 CHARS (character sprites) 1.11 + # 5600 SPRITES (map) 1.12 + # 5780 space 1.13 + # 579c room data (generated) 1.14 + # 5800 screen memory 1.15 + 1.16 files = [] 1.17 1.18 system("ophis mapcode.oph CODE") 1.19 @@ -59,15 +68,15 @@ 1.20 print hex(i + 1) 1.21 i += 1 1.22 1.23 - data = makesprites.read_sprites() 1.24 + data = makesprites.read_sprites(makesprites.chars) 1.25 + files.append(("CHARS", 0x5000, 0x5000, data)) 1.26 + 1.27 + data = makesprites.read_sprites(makesprites.tiles) 1.28 files.append(("SPRITES", 0x5600, 0x5600, data)) 1.29 1.30 t = read_basic("LOADER") 1.31 files.append(("LOADER", 0xffff0e00, 0xffff802b, t)) 1.32 1.33 - t = read_basic("TESTEXITS") 1.34 - files.append(("TEST", 0xffff0e00, 0xffff802b, t)) 1.35 - 1.36 u = UEFfile.UEFfile(creator = 'build.py '+version) 1.37 u.minor = 6 1.38 u.import_files(0, files)
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/images/left1.xpm Sun Aug 07 20:35:37 2011 +0200 2.3 @@ -0,0 +1,23 @@ 2.4 +/* XPM */ 2.5 +static char * left1_xpm[] = { 2.6 +"12 16 4 1", 2.7 +" c None", 2.8 +". c #000000", 2.9 +"+ c #008000", 2.10 +"@ c #FFFF00", 2.11 +"....++++....", 2.12 +"...++++++...", 2.13 +"..++++++++..", 2.14 +"...@.@@+@...", 2.15 +"..@@@@+@@...", 2.16 +"...@@@+@....", 2.17 +"............", 2.18 +"...+++++.++.", 2.19 +"@+.+++++.+++", 2.20 +"@+.+++.++.++", 2.21 +".......++.+.", 2.22 +"...++++@@...", 2.23 +"...++.++....", 2.24 +"...++..+....", 2.25 +"..++.++++...", 2.26 +"..++.++++..."};
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/images/left2.xpm Sun Aug 07 20:35:37 2011 +0200 3.3 @@ -0,0 +1,23 @@ 3.4 +/* XPM */ 3.5 +static char * left2_xpm[] = { 3.6 +"12 16 4 1", 3.7 +" c None", 3.8 +". c #000000", 3.9 +"+ c #008000", 3.10 +"@ c #FFFF00", 3.11 +"....++++....", 3.12 +"...++++++...", 3.13 +"..++++++++..", 3.14 +"...@.@@+@...", 3.15 +"..@@@@+@@...", 3.16 +"...@@@+@....", 3.17 +"............", 3.18 +"...+++++.++.", 3.19 +"@+.+++++.++.", 3.20 +"@+.++.++.++.", 3.21 +"......++.++.", 3.22 +"...+++@@....", 3.23 +"...+++++....", 3.24 +"....++.+....", 3.25 +"..+++++.+...", 3.26 +"..+++++.+..."};
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/images/right1.xpm Sun Aug 07 20:35:37 2011 +0200 4.3 @@ -0,0 +1,23 @@ 4.4 +/* XPM */ 4.5 +static char * right1_xpm[] = { 4.6 +"16 16 4 1", 4.7 +" c None", 4.8 +". c #000000", 4.9 +"+ c #008000", 4.10 +"@ c #FFFF00", 4.11 +"........++++....", 4.12 +".......++++++...", 4.13 +"......++++++++..", 4.14 +".......@+@@.@...", 4.15 +".......@@+@@@@..", 4.16 +"........@+@@@...", 4.17 +"................", 4.18 +".....++.+++++...", 4.19 +"....+++.+++++.+@", 4.20 +"....++.++.+++.+@", 4.21 +".....+.++.......", 4.22 +".......@@++++...", 4.23 +"........++.++...", 4.24 +"........+..++...", 4.25 +".......++++.++..", 4.26 +".......++++.++.."};
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/images/right2.xpm Sun Aug 07 20:35:37 2011 +0200 5.3 @@ -0,0 +1,23 @@ 5.4 +/* XPM */ 5.5 +static char * right2_xpm[] = { 5.6 +"16 16 4 1", 5.7 +" c None", 5.8 +". c #000000", 5.9 +"+ c #008000", 5.10 +"@ c #FFFF00", 5.11 +"...++++.........", 5.12 +"..++++++........", 5.13 +".++++++++.......", 5.14 +"..@+@@.@........", 5.15 +"..@@+@@@@.......", 5.16 +"...@+@@@........", 5.17 +"................", 5.18 +"++.+++++........", 5.19 +"++.+++++.+@.....", 5.20 +"++.++.++.+@.....", 5.21 +"++.++...........", 5.22 +"...@@+++........", 5.23 +"...+++++........", 5.24 +"...+.++.........", 5.25 +"..+.+++++.......", 5.26 +"..+.+++++......."};
6.1 --- a/makesprites.py Sun Aug 07 19:27:49 2011 +0200 6.2 +++ b/makesprites.py Sun Aug 07 20:35:37 2011 +0200 6.3 @@ -17,32 +17,32 @@ 6.4 along with this program. If not, see <http://www.gnu.org/licenses/>. 6.5 """ 6.6 6.7 -sprites = [ 6.8 +tiles = [ 6.9 ("0000000000000000",)*24, 6.10 - ("0000000000000000", 6.11 + ("0002020020000200", 6.12 "0202000200020020", 6.13 - "0000020000212000", 6.14 - "0020200010201020", 6.15 - "0020000020020020", 6.16 + "2000020000211000", 6.17 + "0020200010211022", 6.18 + "2020000020022020", 6.19 "0000020122200000", 6.20 - "0200020020200200", 6.21 + "0200020020200202", 6.22 "0202000000202200", 6.23 - "0200200200222000", 6.24 - "0000202000200000", 6.25 - "0200002020200200", 6.26 - "0001000020000200", 6.27 - "0011010000002000", 6.28 + "0200200200222002", 6.29 + "2000202000200020", 6.30 + "0010002020200200", 6.31 + "0111010020000200", 6.32 + "0011110000002000", 6.33 "0001100020002020", 6.34 "0010220222000020", 6.35 "0000222220202020", 6.36 - "0200022022002000", 6.37 + "0200022022002002", 6.38 "0200022000002020", 6.39 - "0002022200000000", 6.40 - "0022202200200200", 6.41 + "2002022200000000", 6.42 + "0022202200200202", 6.43 "0020202202220020", 6.44 - "0002002222220200", 6.45 + "2002002222220200", 6.46 "0200000220200020", 6.47 - "0000000220000000"), 6.48 + "0002020220002002"), 6.49 ("0022200000000000", 6.50 "0222220000222200", 6.51 "2222220002222220", 6.52 @@ -93,6 +93,41 @@ 6.53 "0000220000002000") 6.54 ] 6.55 6.56 +chars = [ 6.57 + ("000022220000", 6.58 + "000222222000", 6.59 + "002222222200", 6.60 + "000303323000", 6.61 + "003333233000", 6.62 + "000333230000", 6.63 + "000000000000", 6.64 + "000222220220", 6.65 + "320222220222", 6.66 + "320222022022", 6.67 + "000000022020", 6.68 + "000222233000", 6.69 + "000220220000", 6.70 + "000220020000", 6.71 + "002202222000", 6.72 + "002202222000"), 6.73 + ("000022220000", 6.74 + "000222222000", 6.75 + "002222222200", 6.76 + "000303323000", 6.77 + "003333233000", 6.78 + "000333230000", 6.79 + "000000000000", 6.80 + "000222220220", 6.81 + "320222220220", 6.82 + "320220220220", 6.83 + "000000220220", 6.84 + "000222330000", 6.85 + "000222220000", 6.86 + "000022020000", 6.87 + "002222202000", 6.88 + "002222202000") 6.89 + ] 6.90 + 6.91 6.92 def read_sprite(lines): 6.93 6.94 @@ -125,7 +160,7 @@ 6.95 return data 6.96 6.97 6.98 -def read_sprites(): 6.99 +def read_sprites(sprites): 6.100 6.101 data = "" 6.102
7.1 --- a/mapcode.oph Sun Aug 07 19:27:49 2011 +0200 7.2 +++ b/mapcode.oph Sun Aug 07 20:35:37 2011 +0200 7.3 @@ -439,3 +439,65 @@ 7.4 7.5 end_rows: 7.6 rts 7.7 + 7.8 + 7.9 + 7.10 +plot12x16_y0: ; $70,$71=source address 7.11 + ; $72,$73=destination address 7.12 + ldy #23 7.13 + 7.14 +plotloop12x15_y0_0: 7.15 + lda ($70),y 7.16 + sta ($72),y 7.17 + dey 7.18 + bpl plotloop12x15_y0_0 7.19 + clc 7.20 + 7.21 + lda $72 7.22 + adc #$28 7.23 + sta $72 7.24 + lda $73 7.25 + adc #$01 7.26 + sta $73 7.27 + clc 7.28 + 7.29 + ldy #47 7.30 + 7.31 +plotloop12x15_y0_1: 7.32 + lda ($70),y 7.33 + sta ($72),y 7.34 + dey 7.35 + cpy #24 7.36 + bpl plotloop12x15_y0_1 7.37 + 7.38 + rts 7.39 + 7.40 +plot12x16_y1: ; $70,$71=source address 7.41 + ; $72,$73=destination address 7.42 + ldy #3 7.43 + 7.44 +plotloop12x15_y1_0: 7.45 + lda ($70),y 7.46 + sta ($72),y 7.47 + dey 7.48 + bpl plotloop12x15_y1_0 7.49 + clc 7.50 + 7.51 + lda $72 7.52 + adc #$28 7.53 + sta $72 7.54 + lda $73 7.55 + adc #$01 7.56 + sta $73 7.57 + clc 7.58 + 7.59 + ldy #47 7.60 + 7.61 +plotloop12x15_y1_1: 7.62 + lda ($70),y 7.63 + sta ($72),y 7.64 + dey 7.65 + cpy #24 7.66 + bpl plotloop12x15_y1_1 7.67 + 7.68 + rts
