junglejourney
changeset 13:af909a4a6266
Started working on a sprite routine for vertically displaced characters.
| author | David Boddie <david@boddie.org.uk> |
|---|---|
| date | Tue Aug 09 02:32:27 2011 +0200 |
| parents | 398133d27070 |
| children | f6c6beddf999 |
| files | TESTSPRITES build.py mapcode.oph |
| diffstat | 3 files changed, 102 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/TESTSPRITES Tue Aug 09 01:40:46 2011 +0200 1.2 +++ b/TESTSPRITES Tue Aug 09 02:32:27 2011 +0200 1.3 @@ -3,6 +3,7 @@ 1.4 OSCLI("LOAD CHARS") 1.5 1.6 MODE 5 1.7 +VDU 23,1,0;0;0;0; 1.8 VDU 19,2,2;0; 1.9 VDU 19,3,3;0; 1.10 1.11 @@ -10,6 +11,17 @@ 1.12 1.13 ?&70=0 1.14 ?&71=&50 1.15 -?&72=0 1.16 +X%=19*16 1.17 +Y%=0 1.18 + 1.19 +REPEAT 1.20 + 1.21 +?&72=X%+(Y%*4) 1.22 ?&73=&58 1.23 -CALL &{addr} 1.24 +IF Y%=0 THEN CALL &{plot0} ELSE CALL &{plot1} 1.25 + 1.26 +CALL &{key_input} 1.27 +IF ?&74=1 X%=X%-8 1.28 +IF ?&74=2 Y%=1-Y% 1.29 + 1.30 +UNTIL FALSE
2.1 --- a/build.py Tue Aug 09 01:40:46 2011 +0200 2.2 +++ b/build.py Tue Aug 09 02:32:27 2011 +0200 2.3 @@ -49,6 +49,11 @@ 2.4 # Planned memory map 2.5 # 1900 CODE (map) 2.6 # 1x00 space 2.7 + # 4E00 character table (256/4 entries) 2.8 + # n type 2.9 + # n+1 counter/direction 2.10 + # n+2 x position (0-19, top bit 0-1) 2.11 + # n+3 y position (0-27, top bit 0-1) 2.12 # 5000 CHARS (character sprites) 2.13 # 5600 SPRITES (map) 2.14 # 5780 space 2.15 @@ -76,11 +81,14 @@ 2.16 data = makesprites.read_sprites(makesprites.tiles) 2.17 files.append(("SPRITES", 0x5600, 0x5600, data)) 2.18 2.19 - t = read_basic("LOADER").replace("{addr}", "%X" % addresses[-2]) 2.20 + t = read_basic("LOADER").replace("{addr}", "%X" % addresses[-4]) 2.21 2.22 files.append(("LOADER", 0xffff0e00, 0xffff802b, t)) 2.23 2.24 - t = read_basic("TESTSPRITES").replace("{addr}", "%X" % addresses[-1]) 2.25 + t = read_basic("TESTSPRITES") 2.26 + t = t.replace("{plot0}", "%X" % addresses[-3] 2.27 + ).replace("{key_input}", "%X" % addresses[-1] 2.28 + ).replace("{plot1}", "%X" % addresses[-2]) 2.29 files.append(("TEST", 0xffff0e00, 0xffff802b, t)) 2.30 2.31 u = UEFfile.UEFfile(creator = 'build.py '+version)
3.1 --- a/mapcode.oph Tue Aug 09 01:40:46 2011 +0200 3.2 +++ b/mapcode.oph Tue Aug 09 02:32:27 2011 +0200 3.3 @@ -491,3 +491,81 @@ 3.4 bpl plotloop12x24_y0_2 3.5 3.6 rts 3.7 + 3.8 + 3.9 +plot12x24_y1: ; $70,$71=source address 3.10 + ; $72,$73=destination address 3.11 + ldy #3 3.12 + 3.13 + plotloop12x24_y1_0: 3.14 + lda ($70),y 3.15 + sta ($72),y 3.16 + dey 3.17 + bpl plotloop12x24_y1_0 3.18 + clc 3.19 + 3.20 + ldy #11 3.21 + 3.22 + plotloop12x24_y1_1: 3.23 + lda ($70),y 3.24 + sta ($72),y 3.25 + dey 3.26 + cpy #8 3.27 + bpl plotloop12x24_y1_1 3.28 + clc 3.29 + 3.30 + lda $72 3.31 + adc #$38 3.32 + sta $72 3.33 + lda $73 3.34 + adc #$01 3.35 + sta $73 ; 0x140 - 8 3.36 + clc 3.37 + 3.38 + ldy #7 3.39 + 3.40 + plotloop12x24_y1_2: 3.41 + lda ($70),y 3.42 + sta ($72),y 3.43 + dey 3.44 + cpy #4 3.45 + bpl plotloop12x24_y1_2 3.46 + clc 3.47 + 3.48 + ldy #15 3.49 + 3.50 + plotloop12x24_y1_3: 3.51 + lda ($70),y 3.52 + sta ($72),y 3.53 + dey 3.54 + cpy #12 3.55 + bpl plotloop12x24_y1_3 3.56 + 3.57 + rts 3.58 + 3.59 + 3.60 +key_input: 3.61 + lda #129 3.62 + ldx #158 3.63 + ldy #255 3.64 + jsr $fff4 3.65 + cpy #255 3.66 + bne not_left_key 3.67 + lda #1 3.68 + sta $74 3.69 + jmp exit_keys 3.70 +not_left_key: 3.71 + lda #129 3.72 + ldx #151 3.73 + ldy #255 3.74 + jsr $fff4 3.75 + cpy #255 3.76 + bne not_down_key 3.77 + lda #2 3.78 + sta $74 3.79 + jmp exit_keys 3.80 +not_down_key: 3.81 + lda #0 3.82 + sta $74 3.83 +exit_keys: 3.84 + rts
