skeleton speccy player, for now only plays predefined register dump
This commit is contained in:
parent
23fcb4ce95
commit
334e575752
5
tsfm_speccy_player/!build.bat
Normal file
5
tsfm_speccy_player/!build.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
bas2tap -a10 -spsgplay loader.bas loader.tap
|
||||||
|
sjasmplus main.asm --lst=main.lst
|
||||||
|
copy /b loader.tap+player.tap "moebius.tap"
|
||||||
|
pause
|
5
tsfm_speccy_player/.gitignore
vendored
Normal file
5
tsfm_speccy_player/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
*.tap
|
||||||
|
*.sna
|
||||||
|
*.obj
|
||||||
|
*.exe
|
||||||
|
*.lst
|
3
tsfm_speccy_player/loader.bas
Normal file
3
tsfm_speccy_player/loader.bas
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
10 BORDER 0 : PAPER 7 : INK 7 : CLEAR 24575
|
||||||
|
20 LOAD "moebius" CODE
|
||||||
|
100 RANDOMIZE USR 33155
|
229
tsfm_speccy_player/main.asm
Normal file
229
tsfm_speccy_player/main.asm
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
; moe-bius - zx/tsfm player
|
||||||
|
; --atemka 14.o8.2o25
|
||||||
|
|
||||||
|
device zxspectrum128
|
||||||
|
|
||||||
|
ivt equ 0x8000
|
||||||
|
isr equ 0x8181
|
||||||
|
codestart equ 0x8080
|
||||||
|
|
||||||
|
reg_buffer equ 0x5B00 ; basic variables :meatjob:
|
||||||
|
|
||||||
|
EMPTYTAP "psgplay.tap"
|
||||||
|
|
||||||
|
; IM2 vector table - all 257 values for floating bus condition
|
||||||
|
org ivt
|
||||||
|
block 257, (isr >> 8) ; isr at 0x8181
|
||||||
|
|
||||||
|
; dummy ISR (vblank synchronization is done by HALT)
|
||||||
|
org isr
|
||||||
|
stack_top:
|
||||||
|
ei
|
||||||
|
ret
|
||||||
|
|
||||||
|
; entrypoint
|
||||||
|
start:
|
||||||
|
di
|
||||||
|
ld sp, stack_top
|
||||||
|
|
||||||
|
; set IM2 vector table to 0x80
|
||||||
|
ld a, high ivt
|
||||||
|
ld i, a
|
||||||
|
im 2
|
||||||
|
|
||||||
|
; enable interrupts
|
||||||
|
ei
|
||||||
|
.loop:
|
||||||
|
halt
|
||||||
|
|
||||||
|
; output OPN registers
|
||||||
|
; TODO
|
||||||
|
ld hl, test_dump
|
||||||
|
call player.reg_out
|
||||||
|
di
|
||||||
|
halt
|
||||||
|
|
||||||
|
; draw VU meters
|
||||||
|
.base = 0x4000 + 2048*2 + 32*6 + 19
|
||||||
|
ld bc, .base + 0 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu0 equ $-2
|
||||||
|
ld bc, .base + 2 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu1 equ $-2
|
||||||
|
ld bc, .base + 4 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu2 equ $-2
|
||||||
|
ld bc, .base + 7 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu3 equ $-2
|
||||||
|
ld bc, .base + 9 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu4 equ $-2
|
||||||
|
ld bc, .base + 11 ; 10
|
||||||
|
call vumeter.draw_0 ; 17
|
||||||
|
.vu5 equ $-2
|
||||||
|
|
||||||
|
; and jump to next frame
|
||||||
|
xor a : ld bc, 0x7FFD : out (c), a ; map fast page to fix 128k AY ports contention
|
||||||
|
jp .loop
|
||||||
|
|
||||||
|
test_dump:
|
||||||
|
db 0x2F, 0xFF ; prescaler reg
|
||||||
|
db 0x2D, 0xFF ; prescaler reg
|
||||||
|
db 0x30, 0x01
|
||||||
|
db 0x34, 0x21
|
||||||
|
db 0x38, 0x52
|
||||||
|
db 0x3C, 0x02
|
||||||
|
db 0x40, 0x32
|
||||||
|
db 0x44, 0x17
|
||||||
|
db 0x48, 0x1C
|
||||||
|
db 0x4C, 0x03
|
||||||
|
db 0x50, 0x1F
|
||||||
|
db 0x54, 0x1F
|
||||||
|
db 0x58, 0x1F
|
||||||
|
db 0x5C, 0x1F
|
||||||
|
db 0x60, 0x08
|
||||||
|
db 0x64, 0x0C
|
||||||
|
db 0x68, 0x11
|
||||||
|
db 0x6C, 0x09
|
||||||
|
db 0x70, 0x00
|
||||||
|
db 0x74, 0x00
|
||||||
|
db 0x78, 0x01
|
||||||
|
db 0x7C, 0x00
|
||||||
|
db 0x80, 0xC0
|
||||||
|
db 0x84, 0xB1
|
||||||
|
db 0x88, 0x52
|
||||||
|
db 0x8C, 0xF4
|
||||||
|
db 0x90, 0x00
|
||||||
|
db 0x94, 0x00
|
||||||
|
db 0x98, 0x00
|
||||||
|
db 0x9C, 0x00
|
||||||
|
db 0xB0, 0x28
|
||||||
|
db 0x28, 0x00
|
||||||
|
db 0xA4, 0x0C
|
||||||
|
db 0xA0, 0xA3
|
||||||
|
db 0x28, 0xF0
|
||||||
|
db -1
|
||||||
|
|
||||||
|
|
||||||
|
; ----------------------------------------------------
|
||||||
|
; vu meters
|
||||||
|
; orig by natt, rewritten by me
|
||||||
|
|
||||||
|
vumeter:
|
||||||
|
ld a, 0
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu0], hl
|
||||||
|
ld a, 1
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu1], hl
|
||||||
|
ld a, 2
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu2], hl
|
||||||
|
ld a, 3
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu3], hl
|
||||||
|
ld a, 4
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu4], hl
|
||||||
|
ld a, 5
|
||||||
|
call .get_address
|
||||||
|
ld [start.vu5], hl
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
; DE - screen pos, A - register value
|
||||||
|
.get_address:
|
||||||
|
bit 4, a
|
||||||
|
jp nz, .get_e
|
||||||
|
and 0x0E
|
||||||
|
ld h, high .calltab
|
||||||
|
ld l, a
|
||||||
|
ld e, [hl] : inc l
|
||||||
|
ld d, [hl]
|
||||||
|
exd
|
||||||
|
ret
|
||||||
|
.get_e:
|
||||||
|
ld hl, .draw_e
|
||||||
|
ret
|
||||||
|
|
||||||
|
; ------------------
|
||||||
|
; drawing routines
|
||||||
|
; DE - dst
|
||||||
|
.draw_e:
|
||||||
|
ld a, 0b00000000 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11111111 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11000011 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11011111 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11000111 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11011111 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11000011 : ld [bc], a : inc b ; 18
|
||||||
|
ld a, 0b11111111 : ld [bc], a : ret ; 24 = 150t per char
|
||||||
|
|
||||||
|
.draw_0:
|
||||||
|
.draw_1:
|
||||||
|
dup 7 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*7
|
||||||
|
dup 1 : ld a, 0x00 : ld [bc], a : ret : edup ; 24*1
|
||||||
|
.draw_2:
|
||||||
|
dup 6 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*6
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*1
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
.draw_3:
|
||||||
|
dup 5 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*5
|
||||||
|
dup 2 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*2
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
.draw_4:
|
||||||
|
dup 4 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*4
|
||||||
|
dup 3 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*3
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
.draw_5:
|
||||||
|
dup 3 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*3
|
||||||
|
dup 4 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*4
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
.draw_6:
|
||||||
|
dup 2 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*2
|
||||||
|
dup 5 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*5
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
.draw_7:
|
||||||
|
dup 1 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*1
|
||||||
|
dup 6 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*6
|
||||||
|
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
|
||||||
|
|
||||||
|
align 256
|
||||||
|
.calltab:
|
||||||
|
dw .draw_0, .draw_1, .draw_2, .draw_3, .draw_4, .draw_5, .draw_6, .draw_7
|
||||||
|
|
||||||
|
; player include
|
||||||
|
include "player.asm"
|
||||||
|
|
||||||
|
code_end
|
||||||
|
|
||||||
|
; -------------------------------------------------
|
||||||
|
; music pages
|
||||||
|
page 0
|
||||||
|
emptytap "page0.tap"
|
||||||
|
org 0xC000
|
||||||
|
align 256
|
||||||
|
;incbin "!music/200_percent_partyfinal.2.6.psg.packed"
|
||||||
|
savetap "page0.tap",CODE,"page0",0xC000,$-0xC000
|
||||||
|
|
||||||
|
|
||||||
|
; splash screen
|
||||||
|
emptytap "splash.tap"
|
||||||
|
org 0x4000
|
||||||
|
splash:
|
||||||
|
block 6144, 0
|
||||||
|
block 768, (0<<3)|(7<<0)
|
||||||
|
;incbin "200a.scr"
|
||||||
|
savetap "splash.tap",CODE,"splash",0x4000,$-0x4000
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
; ----------------------------------------------------
|
||||||
|
total_codelength equ code_end-codestart
|
||||||
|
|
||||||
|
display "total: ", /a, total_codelength, " bytes"
|
||||||
|
|
||||||
|
savesna "moebius.sna", start
|
||||||
|
savetap "player.tap",CODE,"moebius",codestart,total_codelength
|
||||||
|
|
26
tsfm_speccy_player/player.asm
Normal file
26
tsfm_speccy_player/player.asm
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module player
|
||||||
|
|
||||||
|
; -----------------------------
|
||||||
|
; -----------------------------
|
||||||
|
; OPN register dump output
|
||||||
|
; in: HL - registers in (reg:data) byte pairs, reg==0xFF - return
|
||||||
|
reg_out:
|
||||||
|
ld bc, 0xFFFD
|
||||||
|
ld de, 0x00C0 ; 0xFFBF compensated for outi
|
||||||
|
|
||||||
|
; select 1st chip
|
||||||
|
ld a, 0b11111000
|
||||||
|
out (c), a
|
||||||
|
.loop:
|
||||||
|
ld b, d
|
||||||
|
ld a, [hl]
|
||||||
|
inc a ; test for 0xFF terminator
|
||||||
|
ret z
|
||||||
|
outi
|
||||||
|
ld b, e
|
||||||
|
outi
|
||||||
|
dup 4: nop : edup ; delay
|
||||||
|
jp .loop
|
||||||
|
|
||||||
|
|
||||||
|
endmodule
|
Loading…
Reference in a new issue