# HG changeset patch # User Michael Pavone # Date 1615142495 28800 # Node ID 33f454232aeedaac1fe21f840d9ae08ed6aee45b # Parent 8b2ef428d1aae1eb01678bb7c7cf75ada507568b Added open source TMSS replacement diff -r 8b2ef428d1aa -r 33f454232aee Makefile --- a/Makefile Sun Feb 21 14:35:16 2021 -0800 +++ b/Makefile Sun Mar 07 10:41:35 2021 -0800 @@ -367,6 +367,9 @@ %.bin : %.s68 vasmm68k_mot -Fbin -m68000 -no-opt -spaces -o $@ -L $@.list $< +%.md : %.s68 + vasmm68k_mot -Fbin -m68000 -no-opt -spaces -o $@ -L $@.list $< + %.bin : %.sz8 vasmz80_mot -Fbin -spaces -o $@ $< res.o : blastem.rc @@ -379,6 +382,7 @@ font.tiles : font.png menu.bin : font_interlace_variable.tiles arrow.tiles cursor.tiles button.tiles font.tiles +tmss.md : font.tiles clean : rm -rf $(ALL) trans ztestrun ztestgen *.o nuklear_ui/*.o zlib/*.o diff -r 8b2ef428d1aa -r 33f454232aee build_release --- a/build_release Sun Feb 21 14:35:16 2021 -0800 +++ b/build_release Sun Mar 07 10:41:35 2021 -0800 @@ -32,7 +32,7 @@ make PORTABLE=1 clean all SDLDLLPATH=sdl/i686-w64-mingw32/bin fi -make menu.bin +make menu.bin tmss.md if [ $OS = "Windows" -o $OS = "Win64" ]; then binaries="dis.exe zdis.exe vgmplay.exe blastem.exe $SDLDLLPATH/SDL2.dll" verstr=`sed -E -n 's/^[^B]+BLASTEM_VERSION "([^"]+)"/blastem \1/p' blastem.c` @@ -47,7 +47,7 @@ verstr=`./blastem -v` txt="" fi -binaries="$binaries menu.bin" +binaries="$binaries menu.bin tmss.md" ver=`echo $verstr | awk '/blastem/ { gsub(/\r/, "", $2); print $2 }'` if [ $OS = "Windows" ]; then suffix='-win32' diff -r 8b2ef428d1aa -r 33f454232aee tmss.s68 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tmss.s68 Sun Mar 07 10:41:35 2021 -0800 @@ -0,0 +1,256 @@ + dc.l $0, start + dc.l empty_handler + dc.l empty_handler + ;$10 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$20 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$30 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$40 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$50 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$60 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$70 + dc.l empty_handler + dc.l empty_handler + dc.l int_6 + dc.l empty_handler + ;$80 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$90 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$A0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$B0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$C0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$D0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$E0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + ;$F0 + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.l empty_handler + dc.b "SEGA IS COOL " + dc.b "(C)M.Pavone 2021" + dc.b "TRAIN MEMES STAN" + dc.b "D SILENTLY " + dc.b " " + dc.b "TRIUMPHANT MAMMA" + dc.b "LS SALUTE SOCIAL" + dc.b "ITES " + dc.b "MP 20210227-01",0,0 + dc.b "J " + dc.l $0 + dc.l romend-1 + dc.l $FF0000 + dc.l $FFFFFF + dc.b " " + dc.b " " + dc.b " " + dc.b " " + dc.b "JUE " + +frame_counter equ $FFFF8000 +ram_code equ $FFFF8002 + +empty_handler: + rte +start: + lea $A14000, a3 + move.l #'SEGA', (a3) + lea $C00000, a0 + lea $C00004, a1 + move.w #$8104, (a1) ;Mode 5, everything turned off + move.w #$8004, (a1) + move.w #$8220, (a1) ;Scroll a table $8000 + move.w #$8404, (a1) ;Scroll b table $8000 + move.w #$8560, (a1) ;SAT table $C000 + move.w #$8700, (a1) ;backdrop color 0 + move.w #$8A01, (a1) ;Set HINT counter + move.w #$8B00, (a1) ;full screen scroll + move.w #$8C81, (a1) ;40 cell mode, no interlace + move.w #$8D00, (a1) ;hscroll table at 0 + move.w #$8F02, (a1) ;autoinc 2 + move.w #$9011, (a1) ;64x64 scroll size + move.l #$C0000000, (a1) + move.w #$000, (a0) + move.w #$EEE, (a0) + + ;clear scroll table + move.l #$40000000, (a1) + move.l #0, (a0) + + ;load tiles + move.l #$44000000, (a1) + lea font, a2 + move.w #((fontend-font)/4 - 1), d0 +tloop: + move.l (a2)+, (a0) + dbra d0, tloop + + ;clear name table + move.l #$40000002, (a1) + moveq #32, d0 + move.w #(64*64-1), d1 +ploop: + move.w d0, (a0) + dbra d1, ploop + + move.b #$40, $A10009 + move.b #$00, $A10003 + + move.l #$45960002, d7 + move.l d7, (a1) + move.l #$800000, d6 + + lea ram_code_src(pc), a6 + lea ram_code.w, a5 + moveq #(font-ram_code_src)/2-1, d0 +copy: + move.w (a6)+, (a5)+ + dbra d0, copy + lea $101(a3), a4 + lea $100.w, a5 + move.l #'SEGA', d5 + move.l #' SEG', d4 + moveq #0, d0 + moveq #1, d2 + move.w #180, d3 + btst #6, $A10001 + beq .not_pal + move.w #150, d3 +.not_pal: + jmp ram_code.w + +ram_code_src: + move.b d2, (a4) + cmp.l (a5), d5 + beq.s is_good + cmp.l (a5), d4 + bne.s is_bad +is_good: + move.b d0, (a4) + lea good(pc), a6 + bsr.s print_string + + add.l d6, d7 + move.l d7, (a1) + bsr.s print_string + + add.l d6, d7 + move.l d7, (a1) + bsr.s print_string + + move.w #$8164, (a1) + move #$2500, SR +wait: + cmp.w frame_counter.w, d3 + bne.s wait + move #$2700, SR + move.b d2, (a4) + move.l $0.w, a7 + move.l $4.w, a6 + move.w #$8104, (a1) + move.l d0, (a3) + jmp (a6) + +is_bad: + lea bad(pc), a6 + bsr.s print_string + + add.l d6, d7 + move.l d7, (a1) + bsr.s print_string + + add.l d6, d7 + move.l d7, (a1) + bsr.s print_string + + move.w #$8144, (a1) +forever: + bra.s forever + + +int_6: + addq.w #1, frame_counter.w + rte + +;Prints a null terminated string +;a6 - pointer to string +;a0 - VDP data port +;d0 - base tile attribute +; +;Clobbers: d1.w +print_string: +.loop + moveq #0, d1 + move.b (a6)+, d1 + beq .end + add.w d0, d1 + move.w d1, (a0) + bra .loop +.end + rts + +good: + dc.b " BLASTEM THINKS", 0 + dc.b " THAT THIS CART", 0 + dc.b " TASTES DELICIOUS!", 0 + +bad: + dc.b " *sniff* *sniff*", 0 + dc.b " something doesn't", 0 + dc.b " smell right...", 0 + + align 1 +font: + incbin font.tiles +fontend + +romend