mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-25 17:29:26 +00:00
fire: update to v1.2 with 64-byte fire_extreme
This commit is contained in:
parent
e14ec89248
commit
7e44173ef4
3
fire/fe_monitor
Normal file
3
fire/fe_monitor
Normal file
@ -0,0 +1,3 @@
|
||||
70: 2c 50 c0 20 70 fc a9 ff 99 cf 07 88 d0 fa a9 16 85 25 20 22 fc a0 27 a5 4e f0 05 0a f0 04 90 02 49 1d 85 4e 30 09 b1 28 29 07 aa b5 a8 91 28 88 10 e5 c6 25 10 dc 30 cb 00 bb 00 aa 00 99 00 dd
|
||||
70G
|
||||
|
BIN
fire/fire.dsk
BIN
fire/fire.dsk
Binary file not shown.
@ -1,149 +1,84 @@
|
||||
; Lo-res fire animation, size-optimized
|
||||
; Apple ][ Lo-res fire animation, size-optimized to 64 bytes
|
||||
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
; based on code described here http://fabiensanglard.net/doom_fire_psx/
|
||||
; originally based on code described here
|
||||
; http://fabiensanglard.net/doom_fire_psx/
|
||||
; but this is a slightly different algorithm (but still cool looking)
|
||||
|
||||
; Optimization history:
|
||||
; 80 bytes -- the size of tire_tiny.s
|
||||
; 64 bytes -- use the firmware SCROLL routine to handle the scrolling
|
||||
; this adds some flicker but saves many bytes
|
||||
|
||||
; 611 bytes at first
|
||||
; 601 bytes -- strip out some unused code
|
||||
; 592 bytes -- don't init screen
|
||||
; 443 bytes -- remove more dead code
|
||||
; 206 bytes -- no need to clear screen
|
||||
; 193 bytes -- un-cycle exact the random16 code
|
||||
; 189 bytes -- more optimization of random16 code
|
||||
; 161 bytes -- move to 8-bit RNG
|
||||
; 152 bytes -- reduce lookup to top half colors (had to remove brown)
|
||||
; also changed maroon to pink
|
||||
; 149 bytes -- use monitor GR
|
||||
; 149 bytes -- load into zero page
|
||||
; 140 bytes -- start using zero-page addressing
|
||||
; 139 bytes -- rotate instead of mask for low bit
|
||||
; 138 bytes -- bcs instead of jmp
|
||||
; 137 bytes -- BIT nop trick to get rid of jump
|
||||
; 135 bytes -- push/pull instead of saving to zero page
|
||||
; 134 bytes -- replace half of lookup table with math
|
||||
; 119 bytes -- replace that half of lookup table with better math
|
||||
; 134 bytes -- replace other half of lookup table with math
|
||||
; 132 bytes -- replace stack with zp loads
|
||||
; 129 bytes -- use Y instead of X
|
||||
; 125 bytes -- optimize low byte generationw with branch
|
||||
; 113 bytes -- make get_row a subroutine
|
||||
; 112 bytes -- regrettable change to the low-byte code
|
||||
; 109 bytes -- replace BIT/OR in low calc with an ADC
|
||||
; 107 bytes -- replace self-modifying load/store absolute with Y-indirect
|
||||
; 106 bytes -- assume bit 8 is as random as bit 0
|
||||
; 82 bytes -- use VTAB in firmware to setup addresses
|
||||
; (Antoine Vignau on comp.sys.apple2 reminded me of this)
|
||||
; 81 bytes -- qkumba points out that GR leaves BASL:BASH pointing at line 23
|
||||
; so we can use Y-indirect of BASL to draw the bottom white line
|
||||
; 83 bytes -- remove use of X as counter, use CV instead
|
||||
; 83 bytes -- tried flipping x/y loops in case it allowed more optimization
|
||||
; but the display runs way too slow in that case
|
||||
; 81 bytes -- call LF to increment CV + VTAB all at once
|
||||
; 80 bytes -- re-arrange how the random stuff happens. remove last BIT hack
|
||||
|
||||
; Zero Page
|
||||
SEEDL = $4E
|
||||
TEMP = $00
|
||||
TEMPY = $01
|
||||
OUTL = $04
|
||||
OUTH = $05
|
||||
|
||||
WNDTOP = $22
|
||||
WNDBTM = $23
|
||||
CV = $25
|
||||
BASL = $28
|
||||
BASH = $29
|
||||
H2 = $2C
|
||||
COLOR = $30
|
||||
|
||||
; 100 = $64
|
||||
SEEDL = $4E
|
||||
|
||||
; Soft Switches
|
||||
SET_GR = $C050 ; Enable graphics
|
||||
FULLGR = $C052 ; Full screen, no text
|
||||
LORES = $C056 ; Enable LORES graphics
|
||||
|
||||
; monitor routines
|
||||
ASOFT_GR = $F390
|
||||
MON_SETGR = $FB40
|
||||
|
||||
; VTAB notes
|
||||
; if Applesoft ROM, we can jump to ASOFT_VTAB which takes value in X
|
||||
; this won't work on the original Apple II with Integer ROM
|
||||
; we can jum to MON.TABV instead but then have to copy the value
|
||||
; to Accumulator first
|
||||
; This ovewrites CV (25)
|
||||
; Result is in BASL:BASH (28/29)
|
||||
ASOFT_VTAB = $F25A
|
||||
MON_TABV = $FB5B
|
||||
VTAB = $FC22
|
||||
VTABZ = $FC24
|
||||
LF = $FC66
|
||||
; Monitor ROM routines. Try to use well-known entry points as
|
||||
; these did sometimes change with newer models
|
||||
SCROLL = $FC70
|
||||
VTAB = $FC22 ; takes row in CV, Result is in BASL:BASH ($28/$29)
|
||||
VTABZ = $FC24 ; VTABZ variant vakes row in Accumulator
|
||||
|
||||
fire_demo:
|
||||
|
||||
; GR part
|
||||
; Set lores graphics
|
||||
|
||||
bit SET_GR ; force lores mode ; 3
|
||||
; bit FULLGR ; set by default at bootup?
|
||||
bit SET_GR ; force graphics mode ; 3
|
||||
; happily at bootup FULLGR and LORES
|
||||
; seem to already be in the right positions
|
||||
; so we get LORES 40x48 mode
|
||||
|
||||
|
||||
; Setup white line on bottom
|
||||
; Set window. This seems to be set properly at boot though
|
||||
; lda #0
|
||||
; sta WNDTOP
|
||||
; lda #24
|
||||
; sta WNDBTM
|
||||
|
||||
; note: calling HLINE in firmware would take at least 13 bytes
|
||||
|
||||
; below code is 9
|
||||
; we depend on the call to MON_SETGR leaving BASL:BASH set for line 39
|
||||
; (thanks to qkumba)
|
||||
|
||||
CLEOL2 = $FCA0 ; on original II, they got rid of it on IIe :(
|
||||
|
||||
|
||||
; lda #$ff ; 2 bytes shorter on II/II+
|
||||
; ldy #0
|
||||
; jsr CLEOL2
|
||||
|
||||
|
||||
SCROLL = $FC70
|
||||
WNDTOP = $22
|
||||
WNDBTM = $23
|
||||
; lda #0
|
||||
; sta WNDTOP
|
||||
; lda #24
|
||||
; sta WNDBTM
|
||||
|
||||
scroll_loop:
|
||||
|
||||
KEYPRESS= $C000
|
||||
KEYRESET= $C010
|
||||
jsr SCROLL ; scrolls screen up one row ; 3
|
||||
|
||||
|
||||
;repeat1:
|
||||
; lda KEYPRESS
|
||||
; bpl repeat1
|
||||
; bit KEYRESET
|
||||
;======================================
|
||||
; re-draw bottom line (row 23) as white
|
||||
|
||||
jsr SCROLL
|
||||
|
||||
lda #$ff ; 2
|
||||
; dey ; y is 40 after SCROLL
|
||||
; ldy #39 ; 2
|
||||
lda #$ff ; top/bottom white ; 2
|
||||
; ldy #39 ; Y is left at 40 after SCROLL
|
||||
|
||||
w_loop:
|
||||
sta $7cf,Y ; hline 23 (46+47) ; 2
|
||||
dey ; 1
|
||||
bne w_loop ; 2
|
||||
;============
|
||||
; 9
|
||||
; 8
|
||||
|
||||
fire_loop:
|
||||
|
||||
lda #22 ; start at line 22 ; 2
|
||||
sta CV ; ; 2
|
||||
lda #22 ; start at line 22 ; 2
|
||||
sta CV ; store in Row location ; 2
|
||||
|
||||
yloop:
|
||||
; puts address of row CV into BASL:BASH
|
||||
jsr VTAB ; 3
|
||||
|
||||
ldy #39
|
||||
|
||||
; loop for X values 39 ... 0
|
||||
ldy #39 ; 2
|
||||
xloop:
|
||||
|
||||
;=============================
|
||||
@ -164,8 +99,10 @@ noEor: sta SEEDL ; 2
|
||||
|
||||
; end inlined RNG
|
||||
|
||||
; Randomly either use current value, or decay by one
|
||||
bmi no_change ; assume bit 7 is as random as bit 0 ; 2
|
||||
|
||||
; Lookup the new color in table
|
||||
lda (BASL),Y ; load value ; 2
|
||||
and #$7 ; mask off ; 2
|
||||
tax ; 1
|
||||
|
@ -1,4 +1,12 @@
|
||||
5 HOME
|
||||
10 PRINT "FIRE DEMO V1.2"
|
||||
10 PRINT "FIRE DEMO V1.2 BY DEATER"
|
||||
40 PRINT:PRINT
|
||||
105 PRINT CHR$ (4)"BRUN FIRE_EXTREME"
|
||||
50 PRINT "WHICH DEMO DO YOU WISH TO RUN?"
|
||||
60 PRINT "1. FIRE_TINY (105 BYTES)"
|
||||
70 PRINT "2. FIRE_FIRMWARE (80 BYTES)"
|
||||
80 PRINT "3. FIRE_EXTREME (64 BYTES)"
|
||||
90 INPUT A
|
||||
100 IF A=1 THEN PRINT CHR$ (4)"BRUN FIRE_TINY"
|
||||
110 IF A=2 THEN PRINT CHR$ (4)"BRUN FIRE_FIRMWARE"
|
||||
120 IF A=3 THEN PRINT CHR$ (4)"BRUN FIRE_EXTREME"
|
||||
130 GOTO 5
|
||||
|
Loading…
x
Reference in New Issue
Block a user