; GROOVY.ASM ; GROOVY: Plays 'Groovy' via PSG DAC ; Copyright 1999, Joseph Zbiciak ; ROM header and function stubs adapted from SHELL.SRC by Carl Mueller, Jr. org $5000 ROMWIDTH equ 10 ; rom is 10-bits wide ; EXEC-ROM HEADER ROMHDR: DCW 0, 0 ; ^ moving object grafx DCW lo|RTAB, hi|RTAB ; ^ routine tab DCW lo|START, hi|START ; ^ start program address DCW 0, 0 ; ^ background graphics DCW lo|CARDTAB, hi|CARDTAB ; ^ card tab DCW lo|TITLE, hi|TITLE ; ^ date / title string DCW $9F ; run code after title, clicks on DCW $00 ; -> to STIC $32 DCW $00 ; 0 = color stack, 1 = f/b mode DCW 9, 9, 9, 9 ; color stack elements 1 - 4 DCW $09 ; border color ; Moving Object offsets = last 16 pictures in GRAM ; [What is this for? Do I need it for this program? --JZ] DCW $180, $190, $1A0, $1B0, $1C0, $1D0, $1E0, $1F0 CARDTAB: DCW $1, $0 RTAB: DCW $0, $0 ; TITLE ; Copyright date, title, and code to patch title. PROC TITLE DCW 99, 'GROOVY!', $0 ; 1999 START: ; Code to patch title screen MVO@ R5, R6 ; Cyan screen MVII $09, R0 ; Color 9 is Cyan (pastels.) MVO R0, $28 ; Color stack 0 = Cyan MVO R0, $29 ; Color stack 1 = Cyan MVO R0, $2A ; Color stack 2 = Cyan MVO R0, $2B ; Color stack 3 = Cyan MVO R0, $2C ; Border color = Cyan ; Patch the title string to say '=JRMZ=' instead of Mattel. XORR R3, R3 ; Black MVII $23D, R4 ; First 'Mattel' in top-left JSR R5, $187B ; Write string (ptr in R5) DCW '=JRMZ=', 0 ; Guess who? :-) MOVR R7, R1 SUBI 8, R1 ; Point to '=JRMZ=' above (save 4 words) XORR R3, R3 ; Black MVII $2D5, R4 ; Second 'Mattel' in lower-right JSR R5, $1867 ; Write string (ptr in R1) ; Make all the rest of the text black to match MVII $243, R3 ; Start after first JRMZ MVII 7, R0 ; Mask = 0xFFF8. That's the 1s complement... COMR R0 ; ...of 7. (Saves an SDBD.) MVII 146, R2 ; We only need to touch 146 words. @@titlelp: MVI@ R3, R1 ; Read a word from the display ANDR R0, R1 ; Mask the foreground color MVO@ R1, R3 ; Write the word back INCR R3 ; Point to next word DECR R2 ; Decrement our loop count BNEQ @@titlelp ; Iterate. DIS MVII 1, R0 MVO R0, $108 @@oloop: SDBD MVII groovy, R4 SDBD MVII $1F83, R2 ; Replace w/ length of sample XORR R1, R1 @@iloop: MVI@ R4, R0 ; 11 MVO R1, $01FB ; 11 MVO R1, $20 ; 11 MOVR R0, R1 ; 6 ANDI 15, R0 ; 8 SLR R1, 2 ; 8 SLR R1, 2 ; 8 NOP ; 6 MVO R0, $01FB ; 11 MVO R0, $20 ; 11 DECR R2 ; 6 BNEQ @@iloop ; 9 B @@oloop ; 9 ; Done. MVI@ R6, R7 ; Return to caller ENDP groovy: ; Note: Audio data is manually appended here.