Jump to content
IGNORED

Minesweeper - game released


sometimes99er

Recommended Posts

So I want to implement a timer in the Minesweeper game.

There's a chip inside the TI-99/4A called the TMS9901 and it has a timer. :thumbsup:

ref.:
Nouspikel's TI-99/4A Tech Pages

Back in 2006 I started experimental work on a Sudoku clone, and it used the timer. It worked fine in Mess. :thumbsup:

At one point Tursi implemented support for the 9901 timer. And then it worked fine in Classic99. :thumbsup:

 

Later Mantadoc burned the ROM and tested it on the real iron. And there were some problems with the graphics. Luckily another 3 demos worked fine. :thumbsup:


Later again Classic99 developed the same issue with graphics. A handful of my demos had issues. :|

I think it's safe to say now, that the reason was code at uneven addresses. :) TIAsm and WinAsm99 do not warn or report as error. :|

;)

 

Edit:

Mistake and assumptions about emulators deleted.

Edited by sometimes99er
Link to comment
Share on other sites

Hmm ... I'm pretty sure (really close to 100%) that MESS won't execute code on uneven locations. I know I once had this issue, but I think it was with the 9995 emulation. Can you tell exactly where it happens?

 

Ahhh, my fault. The compiler can compile to an odd address, and then things go wrong. That error does not have to do with the emulator. Sorry, and thanks for feedback. ;)

Edited by sometimes99er
Link to comment
Share on other sites

So I want to implement a timer in the Minesweeper game.

 

There's a chip inside the TI-99/4A called the TMS9901 and it has a timer. :thumbsup:

 

ref.:

Nouspikel's TI-99/4A Tech Pages

 

...

 

Here is a discussion of using the 9901 as a timer: TurboForth Assembler

 

As you will see, there was concern expressed that using the 9901 (as it is wired in the TI-99/4A) as a timer may not be safe.

 

...lee

  • Like 1
Link to comment
Share on other sites

Here is a discussion of using the 9901 as a timer: TurboForth Assembler

 

As you will see, there was concern expressed that using the 9901 (as it is wired in the TI-99/4A) as a timer may not be safe.

 

...lee

Thanks. Maybe I should simply do a brute force count between vdp interrupts a few times, and then decide if it's a 50 or 60 Hz system. Didn't we (here on AtariAge) do that some time ago ? I guess emulation should be able to give a rough but good enough estimate ?

 

:)

Edited by sometimes99er
Link to comment
Share on other sites

I did not follow the discussions about the 9901 at that time (maybe I was not yet member of AA), but "reading too fast" sounds not too likely for me. I don't know what caused the damage of the 9901 as described.

 

The 9901 is a pretty "dumb" chip. It looks complicated from the outside, but things inside are pretty much synchronized to the external clock. It does not even have a READY line. The timer is actually a decrementer that is triggered on every 64 clock pulses. The specs do not reveal anything about minimum timing with respect to program operation. At least it's not comparable to the VDP which has an own flow of control.

 

I think the worst thing that can happen to the 9901 is when its outputs are short-circuited (e.g. when one of the lines INT7* - INT10* are configured to be outputs instead of inputs). Still, there are resistors for protection inside the TI console, so this somewhat remains mysterious.

  • Like 2
Link to comment
Share on other sites

I did not follow the discussions about the 9901 at that time (maybe I was not yet member of AA), but "reading too fast" sounds not too likely for me. I don't know what caused the damage of the 9901 as described.

 

The 9901 is a pretty "dumb" chip. It looks complicated from the outside, but things inside are pretty much synchronized to the external clock. It does not even have a READY line. The timer is actually a decrementer that is triggered on every 64 clock pulses. The specs do not reveal anything about minimum timing with respect to program operation. At least it's not comparable to the VDP which has an own flow of control.

 

I think the worst thing that can happen to the 9901 is when its outputs are short-circuited (e.g. when one of the lines INT7* - INT10* are configured to be outputs instead of inputs). Still, there are resistors for protection inside the TI console, so this somewhat remains mysterious.

 

I agree. I just wanted to bring that discussion reference here to evoke more input :) —especially from @Tursi because he suggested the 9901's use here and was also in on that older discussion and may have some more recent insight.

 

...lee

 

[EDIT: Re above strikethroughs, I'm not sure where I got the idea that @Tursi recently suggested using the 9901 as a timer. It obviously wasn't here!]

Edited by Lee Stewart
Link to comment
Share on other sites

I wondered about that.. everything I know about the 9901 timer I learned from Sometimes99er! :)

 

In the other thread, it's worth noting that hardware was also being developed. We should dedicate a console or two to determining whether timer mode is safe or not.

  • Like 1
Link to comment
Share on other sites

I tried Minesweeper on real iron today, Sometimes99er. I got to the menu selection fine, but the cartridge went off into nirvana when I tried to execute. . .I used my known good cartridge test board with a ZIF socket, jumpered properly for an 8K/16K cartridge, using a known good EPROM. I'll validate the EPROM again in my programmer, just in case it failed to burn properly, but that is the current test status. . .

  • Like 1
Link to comment
Share on other sites

I tried Minesweeper on real iron today, Sometimes99er. I got to the menu selection fine, but the cartridge went off into nirvana when I tried to execute. . .I used my known good cartridge test board with a ZIF socket, jumpered properly for an 8K/16K cartridge, using a known good EPROM. I'll validate the EPROM again in my programmer, just in case it failed to burn properly, but that is the current test status. . .

Thanks. :thumbsup:

 

Also if you could try it out on a minimal configuration. I'm assuming a few things when control is transfered from OS to cartridge *), but has tested with the Classic99's Scramble RAM feature. Also works fine with Js99'er, Win994a, older, newer, 32 and 64 bit versions of MESS.

 

*) I only change 3 vdp registers instead of all 8. Assuming a state of limi 0. Assuming workspace at >83e0. Assuming r15 is >8c02 (vdp address).

 

I don't know if you want to go any further and test more. We could take a route of incremental testing to narrow in on the faulty part(s). - I guess one way for me to go is make an EA3 version. That would maybe reveal a thing or two. And I guess it would be much more easy for many to test. In the end I could eat my hat and release the source.

 

:|

  • Like 2
Link to comment
Share on other sites

You just gave me a thought--I had my Myarc MPES-50 connected to the machine when I did my tests. I don't usually see problems from that one, but I'll try again without it, just in case that introduces something weird into the mix. This one runs from cartridge space and doesn't use the 32K space for anything, correct? The fact that it runs in that many different emulators points to incompatibilities with something in my setup, and that has my curiosity piqued. If it is the MPES-50, I wouldn't worry about changing the code, as I doubt there are more than five or six of them left in the community--and two of those belong to me.

  • Like 2
Link to comment
Share on other sites

You just gave me a thought--I had my Myarc MPES-50 connected to the machine when I did my tests. I don't usually see problems from that one, but I'll try again without it, just in case that introduces something weird into the mix. This one runs from cartridge space and doesn't use the 32K space for anything, correct? The fact that it runs in that many different emulators points to incompatibilities with something in my setup, and that has my curiosity piqued. If it is the MPES-50, I wouldn't worry about changing the code, as I doubt there are more than five or six of them left in the community--and two of those belong to me.

 

Yes, that's correct.

 

I'm also thinking that a DSR could screw up what I see as default values. I know I shouldn't assume too much, just my minimalistic nature around this TI-99/4A retro-computing. Maybe I'm being too smart (in that department), it would only cost a handful of bytes to set all vdp registers, do a limi 0, set the workspace registers, and effectively clear scratch-pad prior to the game and when trying to boot (detecting Fctn Quit (as recommended by Tursi in another thread)).

 

:)

  • Like 1
Link to comment
Share on other sites

 

Yes, that's correct.

 

I'm also thinking that a DSR could screw up what I see as default values. I know I shouldn't assume too much, just my minimalistic nature around this TI-99/4A retro-computing. Maybe I'm being too smart (in that department), it would only cost a handful of bytes to set all vdp registers, do a limi 0, set the workspace registers, and effectively clear scratch-pad prior to the game and when trying to boot (detecting Fctn Quit (as recommended by Tursi in another thread)).

 

:)

 

 

I load the VDP registers in a loop:

 

 

    ; load the vdp registers
        li r2,col32d          ; address of register data
ldvdpr  mov r2,r7                   ; save address for later
        movb *r2+,r1                ; number of registers to load
        sra r1,8                    ; move the count to the low byte
        clr r0                      ; start with register 0
ldvdpl  movb *r2+,r0                ; get register data in r0 MSB
        swpb r0                     ; swap it over
        bl @_vwtr                   ; write the register
        swpb r0                     ; swap it back again
        inc r0                      ; add 1 to register
        dec r1                      ; finished?
        jne ldvdpl                  ; repeat if not

col32d    ; register count and data
        byte 8,>00,>e0,>00,>0e,>01,>06,>02,>f4

 

Could maybe make this code a little shorter by loading the registers backwards (from register 7 to 0) rather than forwards. If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:

  • Like 1
Link to comment
Share on other sites

Unfortunately I'm a sorry-no-good-irritating-no-I-don't-have-real-iron-son-of-a- ...

 

Also I'd like to have a certain degree of confirmation that the game is working and playable on real iron before moving along. EA3 version is in post #40 and cartridge binary is in post #23.

 

As said, it's in a state where it's quite playable, with timer and sounds being the only things missing from making the more complete experience.

 

When these things are done, I'll look into saving a few bytes, maybe add a splash-screen and perhaps doing a built-in optional or standalone "Macintosh" version (opposed to the current "Amiga" style).

 

So, please ...

 

;)

Edited by sometimes99er
Link to comment
Share on other sites

If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:

100 CALL CLEAR :: FOR I=1 TO 16 :: CALL SCREEN(I) :: FOR DELAY=1 TO 100 :: NEXT DELAY :: NEXT I

 

That is what I was referring to. In this case, I is the counter and the screen color.

 

Not a shot for shot likeness, but similar in principle.

  • Like 1
Link to comment
Share on other sites

I load the VDP registers in a loop:

 

...
col32d    ; register count and data
        byte 8,>00,>e0,>00,>0e,>01,>06,>02,>f4

Could maybe make this code a little shorter by loading the registers backwards (from register 7 to 0) rather than forwards. If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:

 

Yes. I'll be doing the loop thing from now on. Thanks. :thumbsup:

  • Like 1
Link to comment
Share on other sites

Unfortunately I'm a sorry-no-good-irritating-no-I-don't-have-real-iron-son-of-a- ...

 

Also I'd like to have a certain degree of confirmation that the game is working and playable on real iron before moving along. EA3 version is in post #40 and cartridge binary is in post #23.

 

As said, it's in a state where it's quite playable, with timer and sounds being the only things missing from making the more complete experience.

 

When these things are done, I'll look into saving a few bytes, maybe add a splash-screen and perhaps doing a built-in optional or standalone "Macintosh" version (opposed to the current "Amiga" style).

 

So, please ...

 

;)

 

I want to test it, but I'm having trouble creating a disk image that works for me... I'm probably missing something obviously stupid, but somehow I'm not succeeding...

 

Just for clarity, a disk image to put on my cf7+, not for an emulator :)

Edited by TheMole
  • Like 1
Link to comment
Share on other sites

I want to test it, but I'm having trouble creating a disk image that works for me... I'm probably missing something obviously stupid, but somehow I'm not succeeding...

 

Just for clarity, a disk image to put on my cf7+, not for an emulator :)

Thanks. :)

 

 

 

Edit: New disk with help from mizapf. Video below changed accordingly.

 

minesweeper0.4.ea3.2.gif

Edited by sometimes99er
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...