diff --git a/demos/second/EFFECTS b/demos/second/EFFECTS new file mode 100644 index 00000000..4d0d98cb --- /dev/null +++ b/demos/second/EFFECTS @@ -0,0 +1,53 @@ +General Note: + require an Apple IIe with 128k. I don't use any advanced IIe + effects (no 65c02, no double-graphics modes). I mostly just + need the 128k of RAM for use as a RAM disk as it's next + to impossible to load data while music is playing. + + Aside about the Disk II, Woz had an amazing design but it's + controlled with cycle-accurae assembly bitbanging the hardware + and is essentially hard real-time. Interrupts or running other + code while loading likely would make the disk fail. I'm only + aware of two demos that do this, X by French Touch and + X by Y. Haven't had a chance to look at what they did. + + Music is using my PT3 player that can play .pt3 tracker files. + + Disk code is by Qkumba. It's super fast. I'm using that with + raw disk sector reads, there's no filesystem on the disk (no AppleDOS + or ProDOS). + + +Intro + horizontal scroll, a bit of a pain + + +Chessboard + various ways to do this. + cheating and using a sprite as didn't have time to hack up + a 3d-render or else some sort of triangle-drawing code + re-using existing sprite code, you can see artifacts on edges + because the code is working at byte-granularity for speed + but each byte holds 3.5 pixels. One way to fix this is to + have a separate mask sprite and oring things but that would + severely reduce the frame rate and take up a lot more space + +Tunnel + I wasted a week trying to get a good tunnel effect and gave + up (after some very interesting chunks of buggy code). + Drawing circles is a pain on 6502. So for this I just + took 2 screenshots and page flip + The real effect here is a bit more interesting that a plain + tunnel as it wiggles the camera around too. + + +Interference + This one is I think just interference between two circles. + This one I used some existing code I had that was doing something + vaguely similar with sine waves. I didn't have time to try + to do the proper effect. Even with table lookups and self-modifying + code and using lo-res the frame rate isn't high and it would probably + be worse if I was doing the proper effect. This effect does + go on forever though. + + diff --git a/demos/second/TODO b/demos/second/TODO index c063fadd..d4c0fbac 100644 --- a/demos/second/TODO +++ b/demos/second/TODO @@ -29,14 +29,15 @@ DISK I - falling effect - moving / bouncing object - - tunnel - - cirles - - interference pattern + have it reverse course? + - tunnel (for real) + - cirles / interference pattern (for real) + Lens / Rotozoom - add lo-res LENS sprite to bounce around - for rotozoom, wrap around note, this might mean 32x32 + - sound file + Plasma - switch to purple green @@ -54,6 +55,7 @@ DISK I - the audio (put in language card of AUX?) - the actual transmission + 45 degree sprite? + ocean / voxels diff --git a/demos/second/part04_chess_shapes/chess.s b/demos/second/part04_chess_shapes/chess.s index c580d5ce..9addeebd 100644 --- a/demos/second/part04_chess_shapes/chess.s +++ b/demos/second/part04_chess_shapes/chess.s @@ -1,5 +1,7 @@ ; Chess board, polyhedrons, circles, interference +; o/~ One night in Bangkok makes a hard man humble... o/~ + ; ; by deater (Vince Weaver) @@ -26,10 +28,86 @@ chess_start: bit FULLGR bit PAGE1 - lda #0 + lda #$FF jsr hgr_page1_clearscreen + lda #$00 jsr hgr_page2_clearscreen + ;========================== + ; Falling board animation + ;========================== + + ; TODO + + ; 148-192 = full = 44 + + ; 0 frames in = 0 high, bottom=125+13 Y=125 + ; 4 frames in, 130-138 = 8 high bottom=138+17 Y=130 + ; 8 frames in, from 135-155 = 20 bottom=155+25 Y=135 + ;12 frames in, from 145-180 = 35 bottom=180 Y=145 + + + ; first collapse down, top to 125 bottom up to 133 + ; so 125 whie other 60 + + ldx #0 + lda #191 + sta COUNT +compact_loop: + + txa + lsr + bcc compact_not_even + + stx SAVEX + + ldx COUNT + + lda hposn_low,X + sta GBASL + lda hposn_high,X + sta GBASH + + lda #0 + ldy #39 +compact_inner_loop2: + sta (GBASL),Y + dey + bpl compact_inner_loop2 + + dec COUNT + + ldx SAVEX + +compact_not_even: + + lda hposn_low,X + sta GBASL + lda hposn_high,X + sta GBASH + + lda #0 + ldy #39 +compact_inner_loop: + sta (GBASL),Y + dey + bpl compact_inner_loop + + lda #50 + jsr wait + + inx + cpx #122 + bne compact_loop + + + + + + ;============================= + ; Bouncing on board animation + ;============================= + bit PAGE2 ; load image offscreen $6000 @@ -45,14 +123,48 @@ chess_start: lda #0 sta COUNT sta DRAW_PAGE +chess_bounce_loop: lda #$60 ; copy to screen jsr hgr_copy - bit PAGE1 + ldx COUNT - jsr wait_until_keypress + lda object_coords_x,X + cmp #$FF + beq done_orange_loop + sta SPRITE_X + lda object_coords_y,X + sta SPRITE_Y + + lda #object_data + sta INH + + jsr hgr_draw_sprite_big + + jsr hgr_page_flip + + inc COUNT + lda COUNT + cmp #48 + bne no_chess_bounce_oflo + lda #0 + sta COUNT + +no_chess_bounce_oflo: + + lda KEYPRESS + bpl chess_bounce_loop + +done_chess_bount_loop: + bit KEYRESET + + ;============================= + ; Orange Blob Animation + ;============================= ; load image offscreen $6000 @@ -189,7 +301,7 @@ wait_irq_loop: rts chess_data: - .incbin "graphics/chess_object2.hgr.zx02" + .incbin "graphics/chessboard.hgr.zx02" orange_data: .incbin "graphics/orange_bg.hgr.zx02" @@ -220,3 +332,20 @@ object_coords_y: .byte 82,82,82,82,82,82,82,82,82,82,82,82 .byte 75,68,62,55,49,43,36,30,23,16,10, 5 + + + + ; 12*4 = 48 +bounce_coords_x: + .byte 13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2 + .byte 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12 + .byte 13,14,15,16,17,18,19,20,21,22,23,24 + .byte 25,24,23,22,21,20,19,18,17,16,15,14 + +bounce_coords_y: + .byte 5,10,16,23,30,36,43,49,55,62,68,75 + .byte 82,82,82,82,82,82,82,82,82,82,82,82 + .byte 82,82,82,82,82,82,82,82,82,82,82,82 + .byte 75,68,62,55,49,43,36,30,23,16,10, 5 + + diff --git a/demos/second/part04_chess_shapes/graphics/Makefile b/demos/second/part04_chess_shapes/graphics/Makefile index b1c575b6..16ce0c17 100644 --- a/demos/second/part04_chess_shapes/graphics/Makefile +++ b/demos/second/part04_chess_shapes/graphics/Makefile @@ -9,7 +9,8 @@ HGR_SPRITE = ../../../../utils/hgr-utils/hgr_make_sprite all: chess_object.hgr.zx02 chess_object2.hgr.zx02 \ orange_bg.hgr.zx02 object.inc \ tunnel1.hgr.zx02 tunnel2.hgr.zx02 \ - tunnel1_cropped.hgr.zx02 tunnel2_cropped.hgr.zx02 + tunnel1_cropped.hgr.zx02 tunnel2_cropped.hgr.zx02 \ + chessboard.hgr.zx02 #### @@ -76,6 +77,15 @@ orange_bg.hgr: orange_bg.png orange_bg.hgr.zx02: orange_bg.hgr $(ZX02) orange_bg.hgr orange_bg.hgr.zx02 +#### + +chessboard.hgr: chessboard.png + $(PNG_TO_HGR) chessboard.png > chessboard.hgr + +chessboard.hgr.zx02: chessboard.hgr + $(ZX02) chessboard.hgr chessboard.hgr.zx02 + + #### diff --git a/demos/second/part04_chess_shapes/graphics/chessboard.png b/demos/second/part04_chess_shapes/graphics/chessboard.png new file mode 100644 index 00000000..625025d0 Binary files /dev/null and b/demos/second/part04_chess_shapes/graphics/chessboard.png differ diff --git a/demos/second/part10_lens_rotozoom/graphics/lens_lores.png b/demos/second/part10_lens_rotozoom/graphics/lens_lores.png new file mode 100644 index 00000000..3629925e Binary files /dev/null and b/demos/second/part10_lens_rotozoom/graphics/lens_lores.png differ diff --git a/demos/second/part15_transmission/graphics/long_sprite.png b/demos/second/part15_transmission/graphics/long_sprite.png new file mode 100644 index 00000000..78b95cc0 Binary files /dev/null and b/demos/second/part15_transmission/graphics/long_sprite.png differ diff --git a/demos/second/part15_transmission/graphics/long_sprite_lores.png b/demos/second/part15_transmission/graphics/long_sprite_lores.png new file mode 100644 index 00000000..ddea1965 Binary files /dev/null and b/demos/second/part15_transmission/graphics/long_sprite_lores.png differ diff --git a/demos/second/part15_transmission/graphics/spheres_lores.png b/demos/second/part15_transmission/graphics/spheres_lores.png new file mode 100644 index 00000000..bd2c3757 Binary files /dev/null and b/demos/second/part15_transmission/graphics/spheres_lores.png differ