mode7: have sound how we like it, but too big by like 50 bytes

working on making things smaller
This commit is contained in:
Vince Weaver 2018-03-19 16:25:36 -04:00
parent 405ea8eb5a
commit 60f306dd5c
6 changed files with 124 additions and 59 deletions

View File

@ -0,0 +1,67 @@
;=====================================================================
;= ROUTINES
;=====================================================================
;================================
; hlin_setup
;================================
; put address in GBASL/GBASH
; Ycoord in A, Xcoord in Y
hlin_setup:
sty TEMPY ; 3
tay ; y=A ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc TEMPY ; 3
sta GBASL ; 3
iny ; 2
lda gr_offsets,Y ; 4
adc DRAW_PAGE ; add in draw page offset ; 3
sta GBASH ; 3
rts ; 6
;===========
; 35
;================================
; hlin_double:
;================================
; HLIN Y, V2 AT A
; Y, X, A trashed
; start at Y, draw up to and including X
hlin_double:
;int hlin_double(int page, int x1, int x2, int at) {
jsr hlin_setup ; 41
sec ; 2
lda V2 ; 3
sbc TEMPY ; 3
tax ; 2
inx ; 2
;===========
; 53
; fallthrough
;=================================
; hlin_double_continue: width
;=================================
; GBASL has correct offset for row/col
; width in X
hlin_double_continue:
ldy #0 ; 2
lda COLOR ; 3
hlin_double_loop:
sta (GBASL),Y ; 6
inc GBASL ; 5
dex ; 2
bne hlin_double_loop ; 2nt/3
rts ; 6
;=============
; 53+5+X*16+5

View File

@ -1,6 +1,6 @@
; Closing Credits
NUM_CREDITS EQU 19
NUM_CREDITS EQU 18
;===================
; init credits
@ -267,8 +267,8 @@ empty:
; subtract one from centering(?)
credits:
.byte 12 ; 14
.asciiz "MUSIC BASE: EA"
.byte 11 ; 17
.asciiz "MUSIC: WAVE BY EA"
.byte 11 ; 16
.asciiz "LZ4 CODE: QKUMBA"
.byte 11 ; 16
@ -276,35 +276,39 @@ credits:
.byte 14 ; 9
.asciiz "FROGGYSUE"
.byte 14 ; 10
.asciiz "PIANOMAN08"
.byte 14 ; 10
.asciiz "UTOPIA BBS"
.byte 10 ; 18
.asciiz "FORD PERFECT (SIC)"
.byte 14 ; 10
.asciiz "PIANOMAN08"
.byte 12 ; 13
.asciiz "THE 7HORSEMEN"
.byte 9 ; 20
.asciiz "MITHLUIN AND ROOSTER"
;.asciiz "MITHLUIN AND ROOSTER"
.asciiz "AAAAAAAAAAAAAAAAAAAA"
.byte 13 ; 12
.asciiz "TALON KARRDE"
;.asciiz "TALON KARRDE"
.asciiz "AAAAAAAAAAAA"
.byte 9 ; 20
.asciiz "WEAVE'S WORLD TALKER"
;.asciiz "WEAVE'S WORLD TALKER"
.asciiz "AAAAAAAAAAAAAAAAAAAA"
.byte 12 ; 14
.asciiz "DAISY AND JUNE"
;.asciiz "DAISY AND JUNE"
.asciiz "AAAAAAAAAAAAAA"
.byte 11 ; 17
.asciiz "TALBOT 0101B CREW"
;.asciiz "TALBOT 0101B CREW"
.asciiz "AAAAAAAAAAAAAAAAA"
.byte 12 ; 13
.asciiz "STEALTH SUSIE"
.byte 11 ; 16
.asciiz "ECE GRAD BOWLING"
;.asciiz "ECE GRAD BOWLING"
.asciiz "AAAAAAAAAAAAAAAA"
.byte 13 ; 11
.asciiz "CORNELL GCF"
.byte 8 ; 21
.asciiz "ALL MSTIES EVERYWHERE"
.byte 17 ; 3
.asciiz "..."
.byte 17 ; 3
.asciiz "..."
thankz:
.asciiz "SPECIAL THANKS TO:"

View File

@ -234,8 +234,6 @@ mb_load_values:
lda NOISE ; 3
bpl mb_not_done ; 3/2nt
lda #1 ; set done playing ; 2
jmp quiet_exit ; 3
;===========
; typ 6
@ -270,22 +268,22 @@ increment_done:
;=================================
done_interrupt:
jmp exit_interrupt
; jmp exit_interrupt
quiet_exit:
sta DONE_PLAYING
jsr clear_ay_both
; sta DONE_PLAYING
; jsr clear_ay_both
;=====================================
; clear register area
;=====================================
ldx #13 ; 2
lda #0 ; 2
mb_clear_reg:
sta REGISTER_DUMP,X ; clear register value ; 4
sta REGISTER_OLD,X ; clear old values ; 4
dex ; 2
bpl mb_clear_reg ; 2nt/3
; ldx #13 ; 2
; lda #0 ; 2
;mb_clear_reg:
; sta REGISTER_DUMP,X ; clear register value ; 4
; sta REGISTER_OLD,X ; clear old values ; 4
; dex ; 2
; bpl mb_clear_reg ; 2nt/3
exit_interrupt:

View File

@ -40,10 +40,23 @@ start:
stx MB_DETECTED
beq mockingboard_setup_done
;================================
; one-time setup
;================================
; Initialize the 2kB of multiply lookup tables
jsr init_multiply_tables
;================================
; Mockingboard start
;================================
main_loop:
mockingboard_setup:
sei ; disable interrupts just in case
jsr mockingboard_init
jsr reset_ay_both
jsr clear_ay_both
@ -63,8 +76,6 @@ mockingboard_setup:
; Enable 50Hz clock on 6522
;============================
sei ; disable interrupts just in case
lda #$40 ; Continuous interrupts, don't touch PB7
sta $C40B ; ACR register
lda #$7F ; clear all interrupt flags
@ -84,7 +95,6 @@ mockingboard_setup:
; 4fe7 / 1e6 = .020s, 50Hz
; 9c40 / 1e6 = .040s, 25Hz
;============================
; Start Playing
;============================
@ -101,13 +111,13 @@ mockingboard_setup:
;=====================================
; clear register area
;=====================================
ldx #13 ; 2
lda #0 ; 2
ldx #13 ; 2
lda #0 ; 2
mb_setup_clear_reg:
sta REGISTER_DUMP,X ; clear register value ; 4
sta REGISTER_OLD,X ; clear old values ; 4
dex ; 2
bpl mb_setup_clear_reg ; 2nt/3
sta REGISTER_DUMP,X ; clear register value ; 4
sta REGISTER_OLD,X ; clear old values ; 4
dex ; 2
bpl mb_setup_clear_reg ; 2nt/3
@ -116,6 +126,7 @@ mb_setup_clear_reg:
mockingboard_setup_done:
;================================
; Clear screen and setup graphics
;================================
@ -125,14 +136,13 @@ mockingboard_setup_done:
lda #$4
sta DRAW_PAGE
; Initialize the 2kB of multiply lookup tables
jsr init_multiply_tables
;================================
; Main Loop
;================================
main_loop:
jsr title_routine
jsr checkerboard_demo
@ -316,12 +326,9 @@ title_routine:
;============================
.include "deater.scrolltext"
.include "a2.scrolltext"
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte $A8,$55,$95,$35,$85
.include "rasterbars.s"
.include "starfield_demo.s"
; next part of logo in end of starfield_demo
.include "../asm_routines/mockingboard_a.s"
.include "credits.s"
@ -332,7 +339,7 @@ title_routine:
;===============================================
.include "../asm_routines/gr_unrle.s"
.include "../asm_routines/gr_hlin.s"
.include "../asm_routines/gr_hlin_double.s"
.include "../asm_routines/gr_setpage.s"
.include "../asm_routines/gr_fast_clear.s"
.include "../asm_routines/pageflip.s"
@ -343,20 +350,14 @@ title_routine:
.include "../asm_routines/gr_plot.s"
.include "../asm_routines/text_print.s"
.include "mode7.s"
.include "mode7_demo_backgrounds.inc"
;===============================================
; More routines
;===============================================
.align 256
music_start:

Binary file not shown.

View File

@ -297,11 +297,9 @@ starcredits_loop:
;====================
; draw the rasterbars
;====================
; lda SPEED
; bne done_rasters
lda YY
cmp #18
cmp #17
beq done_rasters
jsr draw_rasters
@ -320,13 +318,8 @@ done_rasters:
jsr page_flip ; 6
; lda SPEED
; beq no_speed
; dec SPEED
;no_speed:
lda YY
cmp #19 ; NUMBER OF CREDITS
cmp #18 ; NUMBER OF CREDITS
beq done_star_credits
;==================
@ -550,6 +543,10 @@ z_table:
;======================
; some "random" numbers
;======================
random_table EQU $2200
.if 0
random_table:
.byte 103,198,105,115, 81,255, 74,236, 41,205,186,171,242,251,227, 70
.byte 124,194, 84,248, 27,232,231,141,118, 90, 46 ,99, 51,159,201,154
@ -572,6 +569,4 @@ random_table:
.byte 179,175,226,240,228,158, 79
.byte 50,21
;73,253,130, 78,169
.endif