Jump to content
IGNORED

4K Short'n'Sweet game contest


Asmusr

Recommended Posts

Thanks Rasmus for organizing the contest and OLD CS1 for the voting. I had a lot of fun programming my entry, hope you all enjoyed it. Great games from everyone, I was happy to play them.

 

I'm trying to put together a multicart. Is there any reason why your Bounce'n'Pounce cartridge images should not work from another ROM bank than the first/only?

  • Like 1
Link to comment
Share on other sites

 

I'm trying to put together a multicart. Is there any reason why your Bounce'n'Pounce cartridge images should not work from another ROM bank than the first/only?

I think the bnp_4k_c.bin requiring the 32k memory expansion should work. The bnp_fg99.bin won't work as it writes to 7000-7FFF, which would be interpreted as bank switching. RAM is required for the program after decompression. If you want to send me the multicart image in a PM, I can take a look in classic99 at why it doesn't work.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
For this Compo i didn't forget the prizes offered from the TI99iuc and facele.eu :) just needed for a bit of time because the presence to the Vintage Computer Festival event where we partecipated and just back yesterday, but also for complete a suprise for the great three winners.


Rasmus, for his first place, wrote me that prefers to have a 32k expansion as well, instead of the TI99 system and so it will be :)


the prizes are:


RASMUS - 1) TI-99/4A System 32K expansion Card

NANOCHESS - 2) 32K expansion Card

PeteE - 3) TI-30 calculator + 2xPCB for build 512K cartridges.


I will prepare shipping packages in next few days, keep an eye the messages box, i will write you a PM when all will be ready.


Really thanks to all partecipants still once again, for the efforts and nice games developed in this 4k compo 2018 :)

  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 2 weeks later...
  • 6 months later...

This help anyone? ;)

attachicon.gifunlz4.zip

 

I finally tried the cpu-to-vdp and vdp-to-cpu versions of the unzipper and unfortunately they are not working. The issue is that the unpacker needs to read from the destination data just unpacked as well of from the source data, so having source and destination in different memory spaces is not working.

 

The vdp-to-vdp version *is* working after a bit of fiddling, and I'm posting the fixed code below. It's quite slow since it's setting up a read and write address for every byte. And it's not possible to improve the speed by having a buffer between reads and writes, because there is often an overlap between the data it reads and the data it writes within a single run.

* LZ4 decompressor for 9900
* Ported by Tursi from LZ4 data decompressor for Apple II
* by Peter Ferrie (peter.ferrie@gmail.com)

* due to changing VDP address every byte, this function is
* much slower than any of the CPU involved ones.

* unpacker variables, no need to change these
* for now we'll just use registers
src     equ 0
dst     equ 1
end     equ 2
a       equ 3
b       equ 4
count   equ 5
delta   equ 6
temp    equ 7
temp2   equ 8
return  equ 9
return2 equ 12
vread   equ 13
vwrite  equ 14
vaddr   equ 15

* unpacker entrypoint
* Caller must set a VDP read address and disable interrupts
* R0 = src address
* R1 = destination address
* R2 = end of packed data

unpack_lz4_from_to_vdp:
       mov  r11,return                 ; remember return address
       li   vread,vdprd
       li   vwrite,vdpwd

parse_token:
       bl   @set_src
       movb *vread,a                   ; read a token byte
       inc  src
       movb a,b                        ; save it off for later
       srl  a,12                       ; make a counter out of the literal count MS nibble
       jeq  copy_matches               ; if it's zero, go to the match copy

       bl   @build_count               ; check for additional bytes of length
       bl   @do_copy                   ; we know the src, dest, and count, so do it
       c    src,end                    ; see if we're done yet (only place src advances)
       jl   copy_matches               ; skip over if not done and work on the back reference

       b    *return                    ; back to caller

copy_matches:
       bl   @set_src
       movb *vread,delta               ; getsrc -> lsb (sadly it can be unaligned)
       swpb delta
       movb *vread,delta               ; getsrc -> msb - this gives us the offset
       inct src
       mov  b,a                        ; get the token back
       andi a,>0f00                    ; get the reference count from the token
       srl  a,8                        ; make it a count
       bl   @build_count               ; check for additional bytes of length
    
       ai   count,4                    ; reference length always adds 4 bytes
       mov  src,temp                   ; save the current compressed source address
       mov  dst,src                    ; get the current destination pointer
       s    delta,src                  ; and subtract the delta
       bl   @do_copy                   ; we have src, dest, and count, do the copy
       mov  temp,src                   ; restore the compressed pointer
       jmp  parse_token                ; and go parse the next token

do_copy:
       mov  r11,return2
do_copy2:
       bl   @set_src
       movb *vread,temp2               ; read one byte
       inc  src
       bl   @set_dest
       movb temp2,*vwrite              ; write one byte
       inc  dst
       dec  count                      ; count down
       jne  do_copy2                   ; loop if not done
       b    *return2                   ; return if we are

* start with a count in 'a', build an actual count in 'count'
build_count:
       mov  r11,return2
       mov  a,count                    ; store the count
       ci   count,15                   ; if it's not 15, we're done
       jne  bc2
bc1:
       bl   @set_src
       movb *vread,a                   ; get the next byte
       inc  src
       srl  a,8                        ; make it a count
       a    a,count                    ; add it in
       ci   a,255                      ; check if there are more
       jeq  bc1                        ; there are
bc2:
       b    *return2                   ; else we're done

* set src as the VDP read address
set_src:
       mov  src,vaddr
       jmp  vdpwadr
    
* set dest as the VDP write address
set_dest:
       mov  dst,vaddr
       ori  vaddr,>4000
       jmp  vdpwadr

* set VDP address as per vaddr
vdpwadr:
       swpb vaddr
       movb vaddr,@vdpwa
       swpb vaddr
       movb vaddr,@vdpwa
       rt

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...