junglejourney
changeset 27:167c8feb18fe
Started handling 16x16 and 8x8 sprites for enemies/explosions and
projectiles.
Added new 16x16 and 8x8 sprites.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Tue Aug 16 01:49:17 2011 +0200 |
| parents | fab43541effa |
| children | af6c0a43d773 |
| files | build.py images/birdld1.xpm images/birdld2.xpm images/birdlu1.xpm images/birdlu2.xpm images/birdrd1.xpm images/birdrd2.xpm images/birdru1.xpm images/birdru2.xpm images/exit1.xpm images/exit2.xpm images/flowers2.xpm images/leaf3.xpm images/spell1-1.xpm images/spell1-2.xpm makesprites.py mapcode.oph |
| diffstat | 17 files changed, 815 insertions(+), 51 deletions(-) [+] |
line diff
1.1 --- a/build.py Mon Aug 15 01:26:43 2011 +0200 1.2 +++ b/build.py Tue Aug 16 01:49:17 2011 +0200 1.3 @@ -49,9 +49,10 @@ 1.4 # Planned memory map 1.5 # 1900 CODE (map) 1.6 # 1x00 space 1.7 - # 3300 character table (0xf0/6 = 40 entries) 1.8 - # n type (0 missing, 1 player, 2 projectile, 3 explosion, 4) 1.9 - # n+1 counter/direction (player: bit 1 is direction, bit 0 is animation) 1.10 + # 3300 character table (0x3C/6 = 10 entries) 1.11 + # n type (0 missing, 1 player, 2 projectile, 3 explosion, 1.12 + # 4 and higher enemy - bits 3,4,5 are enemy type) 1.13 + # n+1 counter/direction (bits 1,2 are direction, bit 0 is animation) 1.14 # n+2 y room offset (0-10) 1.15 # n+3 dy (0-5) 1.16 # n+4 x room offset (0-10) 1.17 @@ -59,7 +60,14 @@ 1.18 # 1.19 # first character is always the player 1.20 # second character is always the player's weapon 1.21 - # new characters are added 1.22 + # new characters are added after these 1.23 + # 1.24 + # 333C objects/treasure table (0xB4/5 = 36 entries) 1.25 + # n type 1.26 + # n+1 i map offset 1.27 + # n+2 j map offset 1.28 + # n+3 y room offset 1.29 + # n+4 x room offset 1.30 # 1.31 # 33F0 starting room (i, j) 1.32 # 33F2 current room (i, j) 1.33 @@ -69,15 +77,20 @@ 1.34 # 33FB palette workspace (enough for one 5 byte palette entry) 1.35 # 1.36 # 3400 CHARS (character sprites) 1.37 - # 4 * 2 * 0x30 (player movement) 1.38 - # 4 * 0x30 (player demise) 1.39 - # 3 * 2 * 0x10 (projectile) 1.40 - # 4 * 2 * 0x40 (enemies) 1.41 - # 4 * 0x40 (enemy demise) 1.42 - # 3 * 0x40 (weapons) 1.43 - # 4 * 0x40 (treasure) 1.44 - # 1 * 0x40 (exit) 1.45 + # 4 * 2 * 0x30 (player movement) 1.46 + # 4 * 0x30 (player demise) 1.47 + # 4 * 2 * 0x10 (projectile) 1.48 + # 5 * 4 * 2 * 0x40 (enemies) 36C0 1.49 + # 4 * 0x40 (enemy appear) 1.50 + # 4 * 0x40 (enemy demise) 1.51 + # 4 * 0x40 (weapons) 1.52 + # 4 * 0x40 (treasure) 1.53 + # 2 * 0x40 (exit) 1.54 + # 2 * 0x40 (final exit) 1.55 # 1.56 + # 4*2*0x30 + 4*0x30 + 4*2*0x10 + 5*4*2*0x40 + 4*0x40 + 4*0x40 + 4*0x40 + 4*0x40 + 2*0x40 + 2*0x40 + 0x3400 1.57 + # 1.58 + # 45C0 space 1.59 # 5300 SPRITES (map) 1.60 # 5780 space 1.61 # 579c room data (generated)
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/images/birdld1.xpm Tue Aug 16 01:49:17 2011 +0200 2.3 @@ -0,0 +1,23 @@ 2.4 +/* XPM */ 2.5 +static char * birdld1_xpm[] = { 2.6 +"16 16 4 1", 2.7 +" c None", 2.8 +". c #000000", 2.9 +"+ c #FF0000", 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/birdld2.xpm Tue Aug 16 01:49:17 2011 +0200 3.3 @@ -0,0 +1,23 @@ 3.4 +/* XPM */ 3.5 +static char * birdld2_xpm[] = { 3.6 +"16 16 4 1", 3.7 +" c None", 3.8 +". c #000000", 3.9 +"+ c #FF0000", 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/birdlu1.xpm Tue Aug 16 01:49:17 2011 +0200 4.3 @@ -0,0 +1,23 @@ 4.4 +/* XPM */ 4.5 +static char * birdlu1_xpm[] = { 4.6 +"16 16 4 1", 4.7 +" c None", 4.8 +". c #000000", 4.9 +"+ c #FF0000", 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/birdlu2.xpm Tue Aug 16 01:49:17 2011 +0200 5.3 @@ -0,0 +1,23 @@ 5.4 +/* XPM */ 5.5 +static char * birdlu2_xpm[] = { 5.6 +"16 16 4 1", 5.7 +" c None", 5.8 +". c #000000", 5.9 +"+ c #FF0000", 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 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/images/birdrd1.xpm Tue Aug 16 01:49:17 2011 +0200 6.3 @@ -0,0 +1,23 @@ 6.4 +/* XPM */ 6.5 +static char * birdrd1_xpm[] = { 6.6 +"16 16 4 1", 6.7 +" c None", 6.8 +". c #000000", 6.9 +"+ c #FF0000", 6.10 +"@ c #FFFF00", 6.11 +"................", 6.12 +"...+............", 6.13 +"....+...++......", 6.14 +".++.++..+++.....", 6.15 +"..++++...+++....", 6.16 +"....++++..++....", 6.17 +".....++++.++....", 6.18 +"..++..++++++....", 6.19 +"..++++.++++.....", 6.20 +"..++++++++.+....", 6.21 +"...++++++.+++...", 6.22 +"....++++.+++@+..", 6.23 +"...........+++..", 6.24 +"............+++.", 6.25 +"..............+.", 6.26 +"................"};
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/images/birdrd2.xpm Tue Aug 16 01:49:17 2011 +0200 7.3 @@ -0,0 +1,23 @@ 7.4 +/* XPM */ 7.5 +static char * birdrd2_xpm[] = { 7.6 +"16 16 4 1", 7.7 +" c None", 7.8 +". c #000000", 7.9 +"+ c #FF0000", 7.10 +"@ c #FFFF00", 7.11 +"................", 7.12 +"................", 7.13 +"...++......++...", 7.14 +"....++....+++...", 7.15 +".+++++...++++...", 7.16 +"....++++.++++...", 7.17 +".....+++++++....", 7.18 +"......++++++....", 7.19 +".......++++.....", 7.20 +".....+++++.+....", 7.21 +"...++++++.+++...", 7.22 +"...+++++.+++@+..", 7.23 +".++++++....+++..", 7.24 +".++++.......+.+.", 7.25 +".++.........+...", 7.26 +"................"};
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/images/birdru1.xpm Tue Aug 16 01:49:17 2011 +0200 8.3 @@ -0,0 +1,23 @@ 8.4 +/* XPM */ 8.5 +static char * birdru1_xpm[] = { 8.6 +"16 16 4 1", 8.7 +" c None", 8.8 +". c #000000", 8.9 +"+ c #FF0000", 8.10 +"@ c #FFFF00", 8.11 +"................", 8.12 +".............++.", 8.13 +"...........+++..", 8.14 +"..........+@++..", 8.15 +"....++++.++++...", 8.16 +"...++++++.++....", 8.17 +"..+++..+++.+....", 8.18 +"..++..+++++.....", 8.19 +".....+++++++....", 8.20 +".....+++.+++....", 8.21 +"...++++.++++....", 8.22 +"..++++..++++....", 8.23 +".+..+..++++.....", 8.24 +"...++..+++......", 8.25 +"...+............", 8.26 +"................"};
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/images/birdru2.xpm Tue Aug 16 01:49:17 2011 +0200 9.3 @@ -0,0 +1,23 @@ 9.4 +/* XPM */ 9.5 +static char * birdru2_xpm[] = { 9.6 +"16 16 4 1", 9.7 +" c None", 9.8 +". c #000000", 9.9 +"+ c #FF0000", 9.10 +"@ c #FFFF00", 9.11 +"................", 9.12 +".............+..", 9.13 +"...........++...", 9.14 +"..++++....+@+++.", 9.15 +"..++++++.++++...", 9.16 +"...++++++.++....", 9.17 +"....++++++.+....", 9.18 +"......+++++.....", 9.19 +".....+++++++....", 9.20 +".....+++.++++...", 9.21 +"...++++..++++...", 9.22 +"..++++....++++..", 9.23 +"..+.+.....++++..", 9.24 +"....+.......+++.", 9.25 +"....+.......+++.", 9.26 +"................"};
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/images/exit1.xpm Tue Aug 16 01:49:17 2011 +0200 10.3 @@ -0,0 +1,22 @@ 10.4 +/* XPM */ 10.5 +static char * exit1_xpm[] = { 10.6 +"16 16 3 1", 10.7 +" c None", 10.8 +". c #000000", 10.9 +"+ c #008000", 10.10 +"................", 10.11 +"......++++......", 10.12 +"....+++.++++....", 10.13 +"...++.++.+.++...", 10.14 +"..++++++.+.+++..", 10.15 +"..+.+.+.++++.+..", 10.16 +".++++.+.++.+.++.", 10.17 +".++.+++.+++++++.", 10.18 +".++.+.++.+.+.++.", 10.19 +".+++++++.+.++++.", 10.20 +".++.+.+.++++.++.", 10.21 +".++++.++.+.+.++.", 10.22 +".++.++++.+.++++.", 10.23 +".++.+.++.+++.++.", 10.24 +".++++++++++++++.", 10.25 +"................"};
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/images/exit2.xpm Tue Aug 16 01:49:17 2011 +0200 11.3 @@ -0,0 +1,22 @@ 11.4 +/* XPM */ 11.5 +static char * exit2_xpm[] = { 11.6 +"16 16 3 1", 11.7 +" c None", 11.8 +". c #000000", 11.9 +"+ c #008000", 11.10 +"................", 11.11 +"......++++......", 11.12 +"....+++..+++....", 11.13 +"...++......++...", 11.14 +"..++........++..", 11.15 +"..+..........+..", 11.16 +".++..........++.", 11.17 +".+............+.", 11.18 +".+.....++.....+.", 11.19 +".++...........+.", 11.20 +".+....++++...++.", 11.21 +".+............+.", 11.22 +".+..++++++++..+.", 11.23 +".++..........++.", 11.24 +".++++++++++++++.", 11.25 +"................"};
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 12.2 +++ b/images/flowers2.xpm Tue Aug 16 01:49:17 2011 +0200 12.3 @@ -0,0 +1,32 @@ 12.4 +/* XPM */ 12.5 +static char * flowers2_xpm[] = { 12.6 +"16 24 5 1", 12.7 +" c None", 12.8 +". c #000000", 12.9 +"+ c #008000", 12.10 +"@ c #FFFF00", 12.11 +"# c #FF0000", 12.12 +"...+.+..+....+..", 12.13 +".+.+...+...+..+.", 12.14 +"+....+....+@#...", 12.15 +"..+.+...@.+#@.++", 12.16 +"+.+.....+..++.+.", 12.17 +".....+.@+++.....", 12.18 +".+...+..+.+..+.+", 12.19 +".+.+......+.++..", 12.20 +".+..+..+..+++..+", 12.21 +"+...+.+...+...+.", 12.22 +"..@...+.+.+..+..", 12.23 +".@#@.@..+....+..", 12.24 +"..@##@......+...", 12.25 +"...##..@..@.+.+.", 12.26 +"..@.++.##@#@..+.", 12.27 +"....++++##@.+.+.", 12.28 +".+...++.@...+..+", 12.29 +".+...++.....+.+.", 12.30 +"+..+.+++........", 12.31 +"..@#+.++..+..+.+", 12.32 +"..#@+.++.+++..+.", 12.33 +"+..+..++++++.+..", 12.34 +".+.....++.+...+.", 12.35 +"...+.+.++...+..+"};
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 13.2 +++ b/images/leaf3.xpm Tue Aug 16 01:49:17 2011 +0200 13.3 @@ -0,0 +1,31 @@ 13.4 +/* XPM */ 13.5 +static char * leaf3_xpm[] = { 13.6 +"16 24 4 1", 13.7 +" c None", 13.8 +". c #000000", 13.9 +"+ c #008000", 13.10 +"@ c #FFFF00", 13.11 +".............+..", 13.12 +"..++.........++.", 13.13 +".+++.........++.", 13.14 +"..+++.......+++.", 13.15 +"..+++......+++..", 13.16 +".++++...++++++..", 13.17 +".+++++...++++++.", 13.18 +".+++..+......++.", 13.19 +"+++...@@....+++.", 13.20 +"+++...++...+++..", 13.21 +"+++...@@...++...", 13.22 +"++++.......++++.", 13.23 +".+++........++..", 13.24 +".+++.++......+..", 13.25 +".++++++++....++.", 13.26 +".+++++.+.+..++..", 13.27 +"..+++....@...++.", 13.28 +".+++....+++...+.", 13.29 +".+++....@@@..++.", 13.30 +".++.....+++.++++", 13.31 +".+++....@@@..++.", 13.32 +".+++.....+...+..", 13.33 +"..+++........+..", 13.34 +"..+++..........."};
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14.2 +++ b/images/spell1-1.xpm Tue Aug 16 01:49:17 2011 +0200 14.3 @@ -0,0 +1,15 @@ 14.4 +/* XPM */ 14.5 +static char * spell1_1_xpm[] = { 14.6 +"8 8 4 1", 14.7 +" c None", 14.8 +". c #000000", 14.9 +"+ c #FFFF00", 14.10 +"@ c #FF0000", 14.11 +"..+@....", 14.12 +"+...+@..", 14.13 +"......+.", 14.14 +"..@+@..@", 14.15 +".@+..+.+", 14.16 +".+@....@", 14.17 +"..@+..+.", 14.18 +"...@+@.."};
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 15.2 +++ b/images/spell1-2.xpm Tue Aug 16 01:49:17 2011 +0200 15.3 @@ -0,0 +1,15 @@ 15.4 +/* XPM */ 15.5 +static char * spell1_2_xpm[] = { 15.6 +"8 8 4 1", 15.7 +" c None", 15.8 +". c #000000", 15.9 +"+ c #FFFF00", 15.10 +"@ c #FF0000", 15.11 +"..++@...", 15.12 +".@..+@..", 15.13 +"+....++.", 15.14 +"@.@..@+.", 15.15 +"+..+@+..", 15.16 +".@......", 15.17 +"..@+...@", 15.18 +"....@+.."};
16.1 --- a/makesprites.py Mon Aug 15 01:26:43 2011 +0200 16.2 +++ b/makesprites.py Tue Aug 16 01:49:17 2011 +0200 16.3 @@ -45,8 +45,8 @@ 16.4 tiles = [read_xpm("images/flowers.xpm", [(".", "0"), ("@", "1"), ("+", "2")]), 16.5 read_xpm("images/leaf1.xpm"), 16.6 read_xpm("images/leaf2.xpm"), 16.7 - read_xpm("images/stones.xpm", [(".", "2"), ("#", "1"), ("+", "0"), ("@", "3")]), 16.8 - read_xpm("images/rock1.xpm"), 16.9 + read_xpm("images/flowers2.xpm", [(".", "0"), ("#", "1"), ("+", "2"), ("@", "3")]), 16.10 + read_xpm("images/leaf3.xpm", [(".", "0"), ("@", "3"), ("+", "2")]), 16.11 read_xpm("images/rock2.xpm", [(" ", "0"), ("#", "1"), ("@", "2"), ("+", "3")]), 16.12 read_xpm("images/bricks.xpm", [(".", "0"), ("#", "1"), ("+", "2"), ("@", "3")]), 16.13 read_xpm("images/wall1.xpm"), 16.14 @@ -59,7 +59,105 @@ 16.15 read_xpm("images/up1.xpm"), 16.16 read_xpm("images/up2.xpm"), 16.17 read_xpm("images/down1.xpm"), 16.18 - read_xpm("images/down2.xpm")] 16.19 + read_xpm("images/down2.xpm"), 16.20 + 16.21 + # placeholder player demise sprites 16.22 + read_xpm("images/left1.xpm"), 16.23 + read_xpm("images/right1.xpm"), 16.24 + read_xpm("images/up1.xpm"), 16.25 + read_xpm("images/down1.xpm"), 16.26 + 16.27 + read_xpm("images/spell1-1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.28 + read_xpm("images/spell1-2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.29 + # placeholder projectile sprites 16.30 + read_xpm("images/spell1-1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.31 + read_xpm("images/spell1-2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.32 + read_xpm("images/spell1-1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.33 + read_xpm("images/spell1-2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.34 + read_xpm("images/spell1-1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.35 + read_xpm("images/spell1-2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.36 + 16.37 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.38 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.39 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.40 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.41 + read_xpm("images/birdld1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.42 + read_xpm("images/birdld2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.43 + read_xpm("images/birdrd1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.44 + read_xpm("images/birdrd2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.45 + 16.46 + # placeholder enemy sprites 16.47 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.48 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.49 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.50 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.51 + read_xpm("images/birdld1.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.52 + read_xpm("images/birdld2.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.53 + read_xpm("images/birdrd1.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.54 + read_xpm("images/birdrd2.xpm", [(".", "0"), ("+", "2"), ("@", "3")]), 16.55 + 16.56 + # placeholder enemy sprites 16.57 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.58 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.59 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.60 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.61 + read_xpm("images/birdld1.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.62 + read_xpm("images/birdld2.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.63 + read_xpm("images/birdrd1.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.64 + read_xpm("images/birdrd2.xpm", [(".", "0"), ("+", "3"), ("@", "3")]), 16.65 + 16.66 + # placeholder enemy sprites 16.67 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.68 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.69 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.70 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.71 + read_xpm("images/birdld1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.72 + read_xpm("images/birdld2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.73 + read_xpm("images/birdrd1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.74 + read_xpm("images/birdrd2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.75 + 16.76 + # placeholder enemy sprites 16.77 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.78 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.79 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.80 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.81 + read_xpm("images/birdld1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.82 + read_xpm("images/birdld2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.83 + read_xpm("images/birdrd1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.84 + read_xpm("images/birdrd2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.85 + 16.86 + # placeholder enemy appear 16.87 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.88 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.89 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.90 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.91 + 16.92 + # placeholder enemy demise 16.93 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.94 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.95 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.96 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.97 + 16.98 + # placeholder weapons 16.99 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.100 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.101 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.102 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.103 + 16.104 + # placeholder treasure 16.105 + read_xpm("images/birdlu1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.106 + read_xpm("images/birdlu2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.107 + read_xpm("images/birdru1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.108 + read_xpm("images/birdru2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.109 + 16.110 + # exit 16.111 + read_xpm("images/exit1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.112 + read_xpm("images/exit2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.113 + 16.114 + # placeholder final exit 16.115 + read_xpm("images/exit1.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.116 + read_xpm("images/exit2.xpm", [(".", "0"), ("+", "1"), ("@", "3")]), 16.117 + ] 16.118 16.119 16.120 def read_sprite(lines):
17.1 --- a/mapcode.oph Mon Aug 15 01:26:43 2011 +0200 17.2 +++ b/mapcode.oph Tue Aug 16 01:49:17 2011 +0200 17.3 @@ -640,24 +640,24 @@ 17.4 17.5 rts 17.6 17.7 -; Sprite data stored in memory: 00 11 22 33 44 55 66 77 88 99 aa bb 17.8 +; Sprite data stored in memory: 00 04 08 0c 10 14 18 1c 20 24 28 2c 17.9 ; 17.10 ; Write to screen in this arrangement: 17.11 ; -- -- 17.12 -; 00 22 17.13 +; 00 08 17.14 ; 17.15 -; 11 33 17.16 -; 44 66 17.17 +; 04 0c 17.18 +; 10 18 17.19 ; 17.20 -; 55 77 17.21 -; 88 aa 17.22 +; 14 1c 17.23 +; 20 28 17.24 ; 17.25 -; 99 bb 17.26 +; 24 2c 17.27 17.28 plot8x24_y1: ; $70,$71=source address 17.29 ; $72,$73=destination address 17.30 17.31 - ldx #2 17.32 + ldx #2 ; plotting 3 8x8 pieces 17.33 17.34 plotloop8x24_y1_loop: 17.35 17.36 @@ -746,6 +746,7 @@ 17.37 17.38 plotloop16x16_y0_0: 17.39 lda ($70),y 17.40 + eor ($72),y 17.41 sta ($72),y 17.42 dey 17.43 bpl plotloop16x16_y0_0 17.44 @@ -763,6 +764,7 @@ 17.45 17.46 plotloop16x16_y0_1: 17.47 lda ($70),y 17.48 + eor ($72),y 17.49 sta ($72),y 17.50 dey 17.51 cpy #32 17.52 @@ -771,6 +773,190 @@ 17.53 17.54 rts 17.55 17.56 +; Sprite data stored in memory: 00 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 17.57 +; 17.58 +; Write to screen in this arrangement: 17.59 +; -- -- -- -- 17.60 +; 00 08 10 18 17.61 +; 17.62 +; 04 0c 14 1c 17.63 +; 20 28 30 38 17.64 +; 17.65 +; 24 2c 34 3c 17.66 + 17.67 +plot16x16_y1: ; $70,$71=source address 17.68 + ; $72,$73=destination address 17.69 + 17.70 + ldx #3 17.71 + 17.72 + plotloop16x16_y1_loop: 17.73 + 17.74 + ldy #3 17.75 + 17.76 + plotloop16x16_y1_0: 17.77 + lda ($70),y 17.78 + eor ($72),y 17.79 + sta ($72),y 17.80 + dey 17.81 + bpl plotloop16x16_y1_0 17.82 + clc 17.83 + 17.84 + ldy #11 17.85 + 17.86 + plotloop16x16_y1_1: 17.87 + lda ($70),y 17.88 + eor ($72),y 17.89 + sta ($72),y 17.90 + dey 17.91 + cpy #8 17.92 + bpl plotloop16x16_y1_1 17.93 + clc 17.94 + 17.95 + ldy #19 17.96 + 17.97 + plotloop16x16_y1_2: 17.98 + lda ($70),y 17.99 + eor ($72),y 17.100 + sta ($72),y 17.101 + dey 17.102 + cpy #16 17.103 + bpl plotloop16x16_y1_2 17.104 + clc 17.105 + 17.106 + ldy #27 17.107 + 17.108 + plotloop16x16_y1_3: 17.109 + lda ($70),y 17.110 + eor ($72),y 17.111 + sta ($72),y 17.112 + dey 17.113 + cpy #24 17.114 + bpl plotloop16x16_y1_3 17.115 + clc 17.116 + 17.117 + dex 17.118 + bmi plotloop16x16_y1_exit 17.119 + txa 17.120 + and #1 17.121 + bne plotloop16x16_y1_loop_next 17.122 + 17.123 + lda $70 ; add by 4 to start the next half row 17.124 + adc #4 17.125 + sta $70 17.126 + lda $71 17.127 + adc #0 17.128 + sta $71 17.129 + clc 17.130 + 17.131 + lda $72 ; subtract by 0x140 - 4 to plot the next top half row 17.132 + adc #$3c 17.133 + sta $72 17.134 + lda $73 17.135 + adc #$01 17.136 + sta $73 17.137 + clc 17.138 + 17.139 + plotloop16x16_y1_loop_next: 17.140 + clc 17.141 + 17.142 + lda $70 ; add 28 to start the next row 17.143 + adc #$1c 17.144 + sta $70 17.145 + lda $71 17.146 + adc #0 17.147 + sta $71 17.148 + clc 17.149 + 17.150 + lda $72 ; add 4 to plot the next half row 17.151 + adc #4 17.152 + sta $72 17.153 + lda $73 17.154 + adc #0 17.155 + sta $73 17.156 + clc 17.157 + 17.158 + jmp plotloop16x16_y1_loop 17.159 + 17.160 + plotloop16x16_y1_exit: 17.161 + clc 17.162 + rts 17.163 + 17.164 +plot8x8_y0: ; $70,$71=source address 17.165 + ; $72,$73=destination address 17.166 + ldy #31 17.167 + 17.168 + plotloop8x8_y0_0: 17.169 + lda ($70),y 17.170 + sta ($72),y 17.171 + dey 17.172 + bpl plotloop8x8_y0_0 17.173 + clc 17.174 + 17.175 + rts 17.176 + 17.177 +; Sprite data stored in memory: 00 04 17.178 +; 17.179 +; Write to screen in this arrangement: 17.180 +; -- 17.181 +; 00 17.182 +; 17.183 +; 04 17.184 + 17.185 +plot8x8_y1: ; $70,$71=source address 17.186 + ; $72,$73=destination address 17.187 + 17.188 + ldx #1 17.189 + 17.190 + plotloop8x8_y1_loop: 17.191 + 17.192 + ldy #3 17.193 + 17.194 + plotloop8x8_y1_0: 17.195 + lda ($70),y 17.196 + eor ($72),y 17.197 + sta ($72),y 17.198 + dey 17.199 + bpl plotloop8x8_y1_0 17.200 + clc 17.201 + 17.202 + ldy #11 17.203 + 17.204 + plotloop8x8_y1_1: 17.205 + lda ($70),y 17.206 + eor ($72),y 17.207 + sta ($72),y 17.208 + dey 17.209 + cpy #8 17.210 + bpl plotloop8x8_y1_1 17.211 + clc 17.212 + 17.213 + dex 17.214 + bmi plot8x8_y1_exit 17.215 + clc 17.216 + 17.217 + lda $70 ; add by 4 to start the next half row 17.218 + adc #4 17.219 + sta $70 17.220 + lda $71 17.221 + adc #0 17.222 + sta $71 17.223 + clc 17.224 + 17.225 + lda $72 ; subtract by 0x140 - 4 to plot the next top half row 17.226 + adc #$3c 17.227 + sta $72 17.228 + lda $73 17.229 + adc #$01 17.230 + sta $73 17.231 + clc 17.232 + 17.233 + jmp plotloop8x8_y1_loop 17.234 + 17.235 + plot8x8_y1_exit: 17.236 + clc 17.237 + 17.238 + rts 17.239 + 17.240 17.241 check_key: ; x=key code 17.242 lda #129 ; returns y=255 or 0 17.243 @@ -836,6 +1022,9 @@ 17.244 screen_columns_high: .byte $00,$00,$00,$00,$00,$00,$00,$00,$01,$01 17.245 screen_subcolumns_low: .byte $00,$08,$10,$18 17.246 17.247 +enemy_direction_chars_low: .byte $c0,$00,$40,$80,$c0,$00,$40,$80 17.248 +enemy_direction_chars_high: .byte $36,$37,$37,$37,$37,$38,$38,$38 17.249 + 17.250 plot_characters: 17.251 17.252 lda #$00 17.253 @@ -843,23 +1032,25 @@ 17.254 lda #$33 17.255 sta $75 17.256 17.257 - ldy #0 17.258 plot_characters_loop: 17.259 17.260 + ldy #0 17.261 lda ($74),y 17.262 - cmp #1 17.263 - bne plot_characters_next 17.264 + cmp #0 17.265 + bne plot_characters_read_character 17.266 + jmp plot_characters_next 17.267 + 17.268 + plot_characters_read_character: 17.269 + clc 17.270 + 17.271 + sta $77 ; temporarily store the object type 17.272 17.273 ; Use lookup tables to load the offsets into the sprite. 17.274 17.275 ; Direction 17.276 iny 17.277 lda ($74),y 17.278 - tax 17.279 - lda player_direction_chars_low,x 17.280 - sta $70 17.281 - lda player_direction_chars_high,x 17.282 - sta $71 17.283 + sta $80 ; temporarily store the direction 17.284 17.285 ; y 17.286 iny 17.287 @@ -905,35 +1096,111 @@ 17.288 sta $72 17.289 clc 17.290 17.291 + lda $77 17.292 + cmp #1 17.293 + bne plot_characters_loop_not_player 17.294 + 17.295 + ; Plot 8x24 sprites (player) 17.296 + 17.297 + ldx $80 17.298 + lda player_direction_chars_low,x 17.299 + sta $70 17.300 + lda player_direction_chars_high,x 17.301 + sta $71 17.302 + 17.303 ; Use the dy value to determine which plotting routine to use. 17.304 17.305 lda $76 17.306 and #1 17.307 - bne plot_characters_plot_player1 17.308 + bne plot_characters_plot_8x24_1 17.309 17.310 jsr plot8x24_y0 17.311 - jmp plot_characters_exit 17.312 + jmp plot_characters_next 17.313 17.314 - plot_characters_plot_player1: 17.315 + plot_characters_plot_8x24_1: 17.316 clc 17.317 jsr plot8x24_y1 17.318 + jmp plot_characters_next 17.319 17.320 - ; Examine the next character. 17.321 17.322 - iny 17.323 - cpy #$f0 17.324 - bmi plot_characters_loop 17.325 + plot_characters_loop_not_player: 17.326 + cmp #2 17.327 + bne plot_characters_loop_not_projectile 17.328 + 17.329 + ; Plot 8x8 sprites (projectiles) 17.330 + 17.331 + ; Use the dy value to determine which plotting routine to use. 17.332 + 17.333 + lda $76 17.334 + and #1 17.335 + bne plot_characters_plot_8x8_1 17.336 + 17.337 + jsr plot8x8_y0 17.338 + jmp plot_characters_next 17.339 + 17.340 + plot_characters_plot_8x8_1: 17.341 + clc 17.342 + jsr plot8x8_y1 17.343 + jmp plot_characters_next 17.344 + 17.345 + 17.346 + plot_characters_loop_not_projectile: 17.347 + cmp #3 17.348 + bne plot_characters_loop_not_explosion 17.349 + 17.350 + ; Plot 16x16 sprites (explosions) 17.351 + 17.352 + 17.353 + plot_characters_loop_not_explosion: 17.354 + cmp #4 17.355 + bmi plot_characters_loop_not_enemy 17.356 + 17.357 + ; Plot 16x16 sprites (enemies) 17.358 + 17.359 + ; Select the set of sprites to use. 17.360 + 17.361 + and #248 17.362 + lsr 17.363 + lsr ; bits 3,4,5 >> 2 17.364 + clc 17.365 + sta $71 ; 0x00, 0x02, 0x04, 0x06, 0x08 17.366 + 17.367 + ldx $80 17.368 + lda enemy_direction_chars_low,x 17.369 + sta $70 17.370 + lda enemy_direction_chars_high,x 17.371 + adc $71 17.372 + sta $71 17.373 + 17.374 + ; Use the dy value to determine which plotting routine to use. 17.375 + 17.376 + lda $76 17.377 + and #1 17.378 + bne plot_characters_plot_16x16_1 17.379 + 17.380 + jsr plot16x16_y0 17.381 + jmp plot_characters_next 17.382 + 17.383 + plot_characters_plot_16x16_1: 17.384 + clc 17.385 + jsr plot16x16_y1 17.386 + jmp plot_characters_next 17.387 + 17.388 + 17.389 + plot_characters_loop_not_enemy: 17.390 + clc 17.391 17.392 plot_characters_next: 17.393 clc 17.394 - 17.395 + 17.396 ; Examine the next character. 17.397 - tya 17.398 + lda $74 17.399 adc #6 17.400 - tay 17.401 17.402 - cpy #$f0 17.403 - bmi plot_characters_loop 17.404 + cmp #$3c 17.405 + bpl plot_characters_exit 17.406 + sta $74 17.407 + jmp plot_characters_loop 17.408 17.409 plot_characters_exit: 17.410 clc 17.411 @@ -1357,10 +1624,10 @@ 17.412 .byte $60, $56, 0, 0 17.413 17.414 chars_block: .byte <chars_file_name, >chars_file_name 17.415 - .byte 0, $34, 0, 0 17.416 - .byte 0, $34, 0, 0 17.417 - .byte $80, $01, 0, 0 17.418 - .byte $80, $35, 0, 0 17.419 + .byte $00, $34, 0, 0 17.420 + .byte $00, $34, 0, 0 17.421 + .byte $c0, $11, 0, 0 17.422 + .byte $c0, $45, 0, 0 17.423 17.424 init: 17.425 lda #255 17.426 @@ -1421,15 +1688,15 @@ 17.427 17.428 ; Clear the character table and set player position. 17.429 17.430 - ldx #234 17.431 + ldx #0 17.432 clear_character_loop: 17.433 lda #0 17.434 sta $3300,x 17.435 txa 17.436 - sec 17.437 - sbc #6 17.438 + adc #6 17.439 tax 17.440 - bpl clear_character_loop 17.441 + cpx #$f0 17.442 + bmi clear_character_loop 17.443 17.444 lda #1 ; player 17.445 sta $3300 17.446 @@ -1443,6 +1710,71 @@ 17.447 sta $3304 17.448 lda #0 ; dx=0 17.449 sta $3305 17.450 + 17.451 +; lda #$4 ; enemy (0) 17.452 +; sta $330c 17.453 +; lda #0 ; left up (first frame) 17.454 +; sta $330d 17.455 +; lda #3 ; y=3 17.456 +; sta $330e 17.457 +; lda #0 ; dy=0 17.458 +; sta $330f 17.459 +; lda #3 ; x=3 17.460 +; sta $3310 17.461 +; lda #0 ; dx=0 17.462 +; sta $3311 17.463 +; 17.464 +; lda #$c ; enemy (1) 17.465 +; sta $3312 17.466 +; lda #4 ; left down (first frame) 17.467 +; sta $3313 17.468 +; lda #3 ; y=3 17.469 +; sta $3314 17.470 +; lda #0 ; dy=0 17.471 +; sta $3315 17.472 +; lda #7 ; x=7 17.473 +; sta $3316 17.474 +; lda #0 ; dx=0 17.475 +; sta $3317 17.476 +; 17.477 +; lda #$14 ; enemy (2) 17.478 +; sta $3318 17.479 +; lda #2 ; right up (first frame) 17.480 +; sta $3319 17.481 +; lda #7 ; y=7 17.482 +; sta $331a 17.483 +; lda #0 ; dy=0 17.484 +; sta $331b 17.485 +; lda #3 ; x=3 17.486 +; sta $331c 17.487 +; lda #0 ; dx=0 17.488 +; sta $331d 17.489 +; 17.490 +; lda #$1c ; enemy (3) 17.491 +; sta $331e 17.492 +; lda #2 ; right up (first frame) 17.493 +; sta $331f 17.494 +; lda #7 ; y=7 17.495 +; sta $3320 17.496 +; lda #0 ; dy=0 17.497 +; sta $3321 17.498 +; lda #3 ; x=3 17.499 +; sta $3322 17.500 +; lda #0 ; dx=0 17.501 +; sta $3323 17.502 +; 17.503 +; lda #$24 ; enemy (4) 17.504 +; sta $3324 17.505 +; lda #6 ; right down (first frame) 17.506 +; sta $3325 17.507 +; lda #7 ; y=7 17.508 +; sta $3326 17.509 +; lda #0 ; dy=0 17.510 +; sta $3327 17.511 +; lda #7 ; x=7 17.512 +; sta $3328 17.513 +; lda #0 ; dx=0 17.514 +; sta $3329 17.515 rts 17.516 17.517 main:
