load DHGR data from external files and transform it at runtime

This commit is contained in:
4am 2020-11-17 21:11:05 -05:00
parent e7cfb4ce93
commit d162b7fb65
27 changed files with 444 additions and 7759 deletions

View File

@ -1,4 +1,4 @@
CopySelfToAuxmem
!macro COPY_SELF_TO_AUXMEM {
lda #$00
sta $FE
tay
@ -14,4 +14,4 @@ CopySelfToAuxmem
dex
bne -
sta $c004
rts
}

View File

@ -5,7 +5,9 @@
!to "build/FX/DHGR.FIZZLEWH",plain
*=$6000
jsr CopySelfToAuxmem
!source "src/fx/fx.dhgr.common.a"
+COPY_SELF_TO_AUXMEM
jsr FizzleToWhite
jmp FizzleCopy
@ -146,5 +148,3 @@ FizzleCopy
bne @loop
@exit rts
!source "src/fx/fx.dhgr.common.a"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.IRIS",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.iris.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.IRIS.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.IRIS.DATA",plain
*=$A000
!byte 24,40
!byte 24,41
!byte 25,40
@ -3838,3 +3841,4 @@
!byte 0,1
!byte 0,79
!byte 0,0
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.IRISWH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.iris.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.IRIS.DATA"

View File

@ -2,6 +2,8 @@
;(c) 2018-9 by 4am
;
coord = $FE
CoordinatesDHGR = $A000 ; $1E09 bytes ($1E08 on disk + 1 byte EOF marker)
;EndCoordinatesDHGR=CoordinatesDHGR+$1E08
jmp Start
@ -12,7 +14,286 @@ coord = $FE
!source "src/fx/fx.dhgr.common.a"
Start
jsr CopySelfToAuxmem
!macro FX_INITONCE_DHGR .CoordinatesFile, .Start {
InitOnce
bit .Start
lda #$4C
sta InitOnce
+READ_RAM2_WRITE_RAM2
+LOAD_FILE_AT .CoordinatesFile, CoordinatesDHGR
+READ_RAM1_WRITE_RAM1
}
!macro FX_RADIAL2_DHGR .coords {
ldx #$0d
- lda ptrtbl, x
sta $c0, x
dex
bpl -
ldx #3
- lda .coords, x
sta $80, x
lda .coords + 50, x
sta $88, x
dex
bpl -
dex
stx $fe
lda #7
sta $ff
- lda .coords + 18 - 254, x
sta $86, x
lda .coords + 22 - 254, x
sta $88, x
lda .coords + 336 - 254, x
sta $8e, x
inx
bne -
--- ldx #$0e
-- lda $bf, x
bmi +
ldy $be, x
jsr aslmod
sty $be, x
sta $bf, x
sty $fc
clc
adc #>.coords
sta $fd
ldy #0
!byte $a9
- sec
lda ($fc), y
pha
lda $7e, x
sta ($fc), y
pla
sta $7e, x
inx
iny
bcc -
dex
dex
+ dex
dex
bne --
ldx #$0a
ldy #$ff
- lda $fe
eor zerochk, x
bne +
lda $ff
eor zerochk + 1, x
beq ++
+ dex
dex
bpl -
!byte $2c
++ sty $c3, x
+++ dec $fe
bne ---
dec $ff
bpl ---
bmi posttransform ; always branches
aslmod
pha
tya
asl
tay
pla
rol
cmp #$0F
bcc +++
bne +
cpy #4
bcc +++
+ pha
tya
sbc #4
tay
pla
sbc #$0F
cmp #$1E
bcc +
bne ++
cpy #8
bcc +
++ pha
tya
sbc #6
tay
pla
sbc #$1E
+ rts
+++ pha
tya
adc #6
tay
pla
adc #$0F
rts
ptrtbl !word 0, 2, 18, 22, 50, 52, 336
zerochk !word 2046 - 433
!word 2046 - 663
!word 2046 - 251
!word 2046 - 68
!word 2046 - 363
!word 2046 - 19
posttransform
}
!macro FX_RADIAL3_DHGR .coords {
ldx #$15
- lda ptrtbl, x
sta $c0, x
dex
bpl -
ldx #7
- lda .coords + 2, x
sta $80, x
dex
bpl -
ldx #4
stx $ff
dex
- lda .coords + 34, x
sta $8c, x
dex
bpl -
dex
lda #$aa
sta $fe
- lda .coords + 18 - 254, x
sta $8a, x
lda .coords + 24 - 254, x
sta $8c, x
lda .coords + 58 - 254, x
sta $92, x
lda .coords + 300 - 254, x
sta $94, x
lda .coords + 344 - 254, x
sta $96, x
inx
bne -
--- ldx #$16
-- lda $bf, x
bmi +
ldy $be, x
jsr aslmod
sty $be, x
sta $bf, x
sty $fc
clc
adc #>.coords
sta $fd
ldy #0
!byte $a9
- sec
lda ($fc), y
pha
lda $7e, x
sta ($fc), y
pla
sta $7e, x
inx
iny
bcc -
dex
dex
+ dex
dex
bne --
ldy #$ff
ldx #$14
- lda $fe
eor zerochk, x
bne +
lda $ff
eor zerochk + 1, x
beq ++
+ dex
dex
bpl -
!byte $2c
++ sty $c1, x
+++ dec $fe
bne ---
dec $ff
bpl ---
bmi posttransform
aslmod
pha
tya
asl
tay
pla
rol
pha
tya
asl
tay
pla
rol
cmp #$1E
bcc +
bne ++
cpy #8
bcc +
++ pha
tya
sbc #8
tay
pla
sbc #$1E
- cmp #$1E
bcc +++
bne ++
cpy #8
bcc +++
++ pha
tya
sbc #6
tay
pla
sbc #$1E
bcs -
+++ rts
+ pha
tya
adc #6
tay
pla
adc #0
rts
ptrtbl !word 2, 4, 6, 8, 18, 24, 34, 36, 58, 300, 344
zerochk !word 1194 - 493
!word $7fff
!word 1194 - 503
!word 1194 - 673
!word 1194 - 82
!word 1194 - 59
!word 1194 - 130
!word 1194 - 225
!word 1194 - 406
!word 1194 - 24
!word 1194 - 55
posttransform
}
!macro FX_PRECOMPUTED_DHGR .copy, .coords, .wait {
lda #<.coords

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.RAD.DATA",plain
*=$A000
!byte 47,39
!byte 46,39
!byte 45,39
@ -3842,3 +3845,4 @@
!byte 45,40
!byte 46,40
!byte 47,40
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIALWH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL2",plain
@ -7,10 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+FX_RADIAL2_DHGR Coordinates
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial2.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL2WH",plain
@ -7,11 +7,16 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+FX_RADIAL2_DHGR Coordinates
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.radial2.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL3",plain
@ -7,10 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+FX_RADIAL3_DHGR Coordinates
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial3.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL3WH",plain
@ -7,11 +7,16 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+FX_RADIAL3_DHGR Coordinates
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.radial3.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 16
!text "FX/DHGR.RAD.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL4",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial4.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RAD4.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.RAD4.DATA",plain
*=$A000
!byte 0,39
!byte 0,40
!byte 47,40
@ -3842,3 +3845,4 @@
!byte 255,255
!byte 255,255
!byte 255,255
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL4WH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.radial4.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RAD4.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL5",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.radial5.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RAD5.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.RAD5.DATA",plain
*=$A000
!byte 255,255
!byte 255,255
!byte 255,255
@ -3842,3 +3845,4 @@
!byte 0,40
!byte 47,40
!byte 47,39
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RADIAL5WH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.radial5.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RAD5.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RIPPLE",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.ripple.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RIPP.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.RIPP.DATA",plain
*=$A000
!byte 24,40
!byte 9,36
!byte 38,62
@ -3838,3 +3841,4 @@
!byte 37,63
!byte 0,25
!byte 0,0
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.RIPPLEWH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.ripple.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.RIPP.DATA"

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.STAR",plain
@ -7,10 +7,14 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $1
rts
Coordinates
!source "src/fx/fx.dhgr.star.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.STAR.DATA"

View File

@ -1,3 +1,6 @@
!cpu 6502
!to "build/FX/DHGR.STAR.DATA",plain
*=$A000
!byte 24,40
!byte 24,41
!byte 24,39
@ -3838,3 +3841,4 @@
!byte 11,0
!byte 12,0
!byte 13,0
!byte $80 ; EOF

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018 by 4am
;(c) 2018-2020 by 4am/qkumba
;
!cpu 6502
!to "build/FX/DHGR.STARWH",plain
@ -7,11 +7,15 @@
!source "src/fx/fx.dhgr.precomputed.a"
+FX_INITONCE_DHGR CoordinatesFile, PostInit
+COPY_SELF_TO_AUXMEM
PostInit
+FX_PRECOMPUTED_DHGR HGRHalfBlockToWhite, Coordinates, $0
+FX_PRECOMPUTED_DHGR HGRHalfBlockCopy, Coordinates, $0
rts
Coordinates
!source "src/fx/fx.dhgr.star.data.a"
!byte $80
Coordinates=CoordinatesDHGR
CoordinatesFile
!byte 17
!text "FX/DHGR.STAR.DATA"