Jump to content
IGNORED

[Boriel’s ZX-Basic] joystick from i/o and halt for waitvbl not working


Recommended Posts

finally i'm having one of my SG1000/MSX1 Boriel’s ZX-Basic examples working on ColecoVision

 

The problem is that i don’t know why the joystick (accessed from i/o) is not working as expected (i don’t want to use the bios routines since i think it wastes that precious ram area, and i’m still not comfortable enough with that), and i can’t use halt as waitvbl (i think that there should be some code related to nmi there?)

 

about the joystick, perhaps i should use di and ei before and after accessing the joystick from i/o? or is it something else?

 

the sources (in Boriel’s ZX-Basic, and the intermediary .asm for debuging) and the resulting .rom file is there

Link to comment
Share on other sites

(btw, if anyone can share a similar, simple and compilable example in assembly, that shows us how to code a small example of how to move sprites with joysticks read from i/o ports as nice as needed, and using halt for waitvbl, please do! this would be really amazing and very useful, and will help to improve a lot the development stage of targeting ColecoVision from Boriel’s ZX-Basic Compiler! ;) )

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

awesome, thanks! i'm going to look that right now! :)

 

btw, in the meanwhile, i were replacing this below right now: (i actually were using it on the sg1000 stuff i was using, i’m really stupid... :S )

 

 

asm
  defw $aa55,0,$7000,0,0,startboot
  defw 0,0,0,0,0,0,0,0,0,0,0
  retn
  startboot:
  end asm

 

with

 

 

asm
  defw $aa55,0,$7000,0,0,startboot
  defw 0,0,0,0,0,0,0,0,0,0,0
  ;retn
  push af 
  in a,($bf) 
  pop af 
  ei 
  reti
  startboot:
  end asm

 

now, halt seems to work for waitvbl! :)

Link to comment
Share on other sites

Maybe you can find what you're looking for in these games (all include source code):

 

http://theadamresource.com/programs/

the games, i only found sources in C there, and i was looking for z80 assembly only... :S (i'm not that comfortable in C, and i also don’t know how to get .asm conversions from there... :S )

 

btw, for now, i'm only struggling with the joystick stuff - do we really need to read joystick from bios calls (i guess?), and waste that precious 12 bytes in that tiny 1kb of ram available (of course i'm not complaining, PacMan arcade machine also has 1kb of ram - and Atari 2600 even less, 128 bytes! :D ), or is there some wiser and neater way of accessing joysticks via i/o than what i'm trying to do?

Link to comment
Share on other sites

that was exactly the documentation i'm using, but i really had no idea about these nops, let me try that! thanks! :)

i tried with 2 (and 4 nops as well, just in case) - http://nitrofurano.altervista.org/retrocoding/colecovision/misc/example01z2e3_movingsprites_waitvbl_joystick.zip

 

on Meka, the 1st joystick works fine and the 2nd doesn’t, and on Mess, the 2nd joystick works fine and the 1s joystick doesn’t - it’s quite weird because all the games i normally play on Mess (and i think it emulate ColecoVision fine for what i were used, i never complained about any weird situation)

 

from the attachment above, perhaps you can figure out more easily what is happening? and which emulator (that runs on GNU/Linux) you recommend, besides these i were using? (i guess would be not that issue, i were using them normally without any special problem...)

 

thanks again! :)

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...