Where to upload less-than-stellar homebrew?

Page 1/2
| 2

By Uninteresting

Expert (96)

Uninteresting's picture

28-08-2016, 15:13

This past month, I've been working on my first ASM program ever: a straightforward two-player card game for MSX1. It's currently "playable" (very basic graphics, basic and slow AI, no animation, some more warts, the PRNG using 8 bits is insufficient to properly shuffle the decks and there is no sound at all after I turned the keyboard sounds off)... at least on blueMSX.

Is there a repository for MSX software that has... well, shall we say "sufficiently lax" requirements on the quality of what is uploaded there?

This was first and foremost a challenge I set upon myself, which is the reason I tried not to copypaste any code (including multiplication or random-number generation) and why the code looks like an attempt to write Canterbury Tales after learning English for one year as a foreign language.

In the unlikely event you want to see what the game is like (.bin) and very hastily written game rules, they're here.

Login or register to post comments

By snout

Ascended (15187)

snout's picture

28-08-2016, 16:34

Yes, definitely! A good starting point would be this form . ;)

By Vampier

Prophet (2296)

Vampier's picture

29-08-2016, 05:29

maybe you could make it into a 'ROM' instead of a bin ... most people use 'ROM's these days.

By Uninteresting

Expert (96)

Uninteresting's picture

29-08-2016, 06:27

@snout The software I've downloaded on this site has been a tier or two above mine, which is why I see this site as an unideal solution, although I do assume the submissions are properly curated?

@Vampier I found a forum post that helped me make a BIN file, but had no such luck with creating ROM files in tniASM. If you have a link to a page with information on how to create ROM files, feel free to share. Now that I think of it, I could try and take a look at Transball source code again and see what parts in it are relevant and which are not... and hope that I haven't done something that makes the change harder than it should.

By santiontanon

Paladin (822)

santiontanon's picture

29-08-2016, 11:21

Hi Uninteresting, I'd be quite happy if the Transball source code can be of help! Smile

Here is a small "hello world" example that generates a rom file (I compile with JASM, but should not be hard to update syntax to tniASM):

;-----------------------------------------------
CHGET: equ 009fh
CHPUT: equ 00a2h
KILBUF: equ 0156h
KEYS: equ 0fbe5h
;-----------------------------------------------

    org 04000H   ; Somewhere out of the way of small basic programs
;-----------------------------------------------
    db "AB" ;   ROM signature
    dw Execute  ; start address
    db 0,0,0,0,0,0,0,0,0,0,0,0
;-----------------------------------------------

Begin:

Execute:
    ld hl,helloWorld
Loop:
    ld a,(hl)
    and a
    jr z,WaitForKey
    call CHPUT
    inc hl
    jr Loop

; This waits for SPACE to be pressed:
    ld  a,(KEYS+8)  ;space
    bit 0,a
    jp  nz,WaitForKey
    call KILBUF     ; this empties the buffer of keys that have been pressed
    di
    halt

helloWorld:
    db "Hello world!",0

End:         

    ds 8000h - $

By Uninteresting

Expert (96)

Uninteresting's picture

29-08-2016, 17:08

Yeah, Transball source was already of help when I tried to get 16x16 sprites to work (although the biggest problem was in that I didn't understand why all my 4 sprites used the same pattern).

The straightforward replacement of the header and the end got me to the point where I got something to run (change the screen), but hung up at that point. I have an idea of where I'm going wrong (trying to write new values into addresses that are now in ROM instead of RAM, creating an infinite loop at this point and other major issues later down the line, which I remember being addressed in some thread earlier).

Oh well, I don't remember anyone saying this'd be easy Smile

By santiontanon

Paladin (822)

santiontanon's picture

30-08-2016, 00:50

haha, yeah, I remember having the same problem when I was playing with creating roms as well. When you plug a cartridge on an MSX, some parts of the address space are remapped for the content of the ROM in the cartridge, and some parts are still mapped to RAM. So, you have to make sure that all the variables you want to be able to change are in the memory space that is still mapped to RAM. For example, if you start your code at "org #4000", then you can have your RAM at "org #c000".

So, for example, if you change the end of the example above by this:

End:
    ds 8000h - $

    org #c000
RAM:    
my_variable1:
    ds virtual 1
my_variable2:
    ds virtual 1

Now you have two variables (my_variable1 and my_variable2) that you can change from your program without problems. Notice, however, that these new variables are not initialized directly in the code (i.e., they are defined as "ds virtual XXX", where "XXX" is the number of bytes you want to reserve for them).

and hehehe, yeah, it's not easy, but it's sure fun Smile

By Vampier

Prophet (2296)

Vampier's picture

30-08-2016, 06:48

I only made one game in assembly in my life (and then I forgot how to do assembly Tongue) I used TNIasm (great compiler)

http://www.msxgamesworld.com/gamecard.php?id=3052

By Uninteresting

Expert (96)

Uninteresting's picture

30-08-2016, 06:53

Looking through Transball source code helped me again to realize just that - ROM and RAM just occupy different parts of one range of integers instead of some overlapping address spaces like I originally thought (although I'm still lost on what pages, slots and banks really are). In any case, the game feels like it's "playable", but in one part of the screen the graphics are jumbled and it won't run on openMSX because the ROM size isn't a multiple of 8k yet. That's something to look at after work...

Plus I expect this game won't run well on TurboR since I used busy-waits to slow down the cursor movement rather than looking into interrupts and such.

In any case, many thanks for showing Transball source code and having it that well commented.

By Uninteresting

Expert (96)

Uninteresting's picture

30-08-2016, 18:53

Okay, I think I managed to turn it into a ROM. Thanks for your help! The error was because I had for some reason flipped DE and HL parameters for LDIVRM... and another bug I found because I had previously used DS instead of RS.

By santiontanon

Paladin (822)

santiontanon's picture

31-08-2016, 00:20

No problem! glad to help (I was in exactly your situation just two-three months ago, when I started coding Transball Smile )

@Vampier: ha! nice!

Page 1/2
| 2