dMZX Forums: MZX and reading/writing data files, joystick q's - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

MZX and reading/writing data files, joystick q's

#1 User is offline   djtiesto 

  • SHOPPING PLEASE
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,660
  • Joined: 01-June 04
  • Gender:Male
  • Location:Long Island

Posted 10 June 2007 - 09:03 PM

I don't really take advantage of a lot of later MZX features, unfortunately... but I was wondering if file read/write was in place...

This is what I wanna do:
Have an entirely custom (I.E. no F3) save function, that'll allow you to select what slot (from 1-3) to save the game in)... easy enough to do. But I also want that when you save the game, it writes the area and some character stats into a data file, so when you first start up Kikan again, and select "LOAD", it'll read in a data file and display the info back to MZX.

What's the best way to go about doing this?

And also while I'm in here... I wanna have joystick support in my game. How would I map the following keys:

Up/Down/Left/Right - Joy Up/Down/Left/Right
CTRL - Joy Button 1
SPACE - Joy Button 2
ENTER - Joy Button 3
P Key - Joy Button 1, 2, 3, 4


Thanks so much, folks!
Posted Image

Posted Image
0

#2 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 10 June 2007 - 10:12 PM

Yeah, you can read and write to files. Check in the Counters section in the help file, under File Access.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#3 User is offline   KKairos 

  • not an actual chipmunk
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,245
  • Joined: 05-August 00
  • Gender:Male

Posted 10 June 2007 - 11:26 PM

I think for joystick support (and correct me if I am wrong) you might just need to tell people to grab some joystick emulation software and use that for mappage.
darganflayer.net kaikairos.dev itch.io
0

#4 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 10 June 2007 - 11:29 PM

KKairos, on Jun 11 2007, 09:26 AM, said:

I think for joystick support (and correct me if I am wrong) you might just need to tell people to grab some joystick emulation software and use that for mappage.

You're wrong.

From config.txt
# Joystick options

# It is possible to emulate key presses using a joystick. If this file
# is config.txt these options will apply as a default to all games -
# you can put them in game.cnf to apply specifically to game.mzx.

# A joystick is first specified as joyN where N is the number from
# 1 onwards identifying the joystick in your system. You may have
# to experiment to find which joystick is which number, if you have
# multiple ones, otherwise just use 1. Up to 16 joysticks are
# recognized.
# You can currently map two things, axes and buttons.
# Axes/buttons are mapped to keys given by number. You can find out
# a key's number by printing key_pressed in a loop (NOT key_code).
# Axis mapping looks as follows:

#joyXaxisY = A, B

# Where X is the number of the joystick, Y is the number of the axis
# (1 is typically left/right, 2 is typically up/down), A is the key
# for one extreme (such as left) and B is the key for the other
# (such as right).

# Button mapping looks as follows:

#joyXbuttonY = A

# Where X is the number of the joystick, Y is the number of the button
# (you may have to experiment to find out which button is which number),
# and A is the key whose press is emulated when this button is pressed.

Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#5 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 10 June 2007 - 11:46 PM

sigh lancer will you ever learn to love <:(

anyway, KKairos is CORRECT in my opinion! Using config.txt is pretty lousy because, well, some people's joysticks are different. Like paulguy has one that starts the buttons at number 16, I think.

So basically in addition to making a config.txt setup for the 'normal people', you give a diagram of a controller and point out what key_pressed value goes where and people will go through it pretty easily
Need a dispenser here.
0

#6 User is offline   KKairos 

  • not an actual chipmunk
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,245
  • Joined: 05-August 00
  • Gender:Male

Posted 11 June 2007 - 12:02 AM

Well, I'm pretty sure I'm wrong in my opinion--because lancer just pointed out that MZX does have support for it.
darganflayer.net kaikairos.dev itch.io
0

#7 User is offline   hob nado 

  • Ancient Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 4,718
  • Joined: 23-September 00
  • Gender:Male

Posted 11 June 2007 - 12:15 AM

Doing a custom save/load system seems like a lot of work. What could be gained from this exactly?
0

#8 User is offline   Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,960
  • Joined: 12-October 00
  • Gender:Male

Posted 11 June 2007 - 12:28 AM

Being able to pluck out bits of information about the save and display it several times more easily than in a converntional save file. The save information shown can include time played, location, characters in party, levels of party members, money held, and so on.

Of course, you could do that kind of slot system with normal MZX savetypes too, especially now that you can save and load games through Robotic, but the focus changes to writing information to the board. =P

Traditional MZX saves are also bloated, bloated beasts. The most extreme case right now is LoR, which has its saves take up nearly 7MB.

either way.
angelic stream - shed sanguine - ill-adapt - avis - para/lyser - renaissance - dead tangent - phosphene blur - birth breeds death - ________ - painted glass - lagniappe

<Exophase> HES STEALING MAH AIRSHIP!!!!!!11111111
0

#9 User is offline   Risu2112 

  • I can't get the top off this bottle
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,864
  • Joined: 12-August 01
  • Gender:Male

Posted 12 June 2007 - 11:36 PM

Yeah a lot can be gained with a custom save engine. In my case it actually became necessary for sfmzx to allow more than one saved game per copy of sfmzx due to the way it reads & writes to files. Also allows some handy info to be viewed before loading.
http://kenohki2112.h.../datascreen.bmp
Respond! Vibrate! Feed back! Resonate!
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112
0

#10 User is offline   apage43 

  • Veteran Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,199
  • Joined: 13-November 00
  • Gender:Male

Posted 17 June 2007 - 03:20 PM

Pack in http://www.digitalmz...es/joysetup.zip and let them map the keys how the like.
Or just look at how I did it and make your own joystick config panel specific to your game.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

4 User(s) are reading this topic
0 members, 4 guests, 0 anonymous users