Language…
11 users online: Buzbee, Daizo Dee Von, GiraffeKiller, karls_Corinthia, kurtistrydiz, Maniek, milgrips, MM102, scratch, TokZone, Zavok - Guests: 65 - Bots: 80
Users: 57,945 (2,499 active)
Latest user: karls_Corinthia

Posts by anonymousbl00dlust

anonymousbl00dlust's Profile → Posts

  • Pages:
  • 1
  • 2
  • 35
  • 36
  • 37
  • 38
Hey all,

Since I am riding on the upload of hackers dreams, I would like to continue with a few more bits of bonus content and streaming for those interested. Therefore, I will be doing livestreams this weekend covering the following content:


Making an ASM patch that allows you to remap controls ingame. This is mostly complete and will be uploaded to this thread.

Tutorial on how to use aZSNES to play mp3s etc in your hack (or do anything else).

Playing some hackers dreams levels RTA

Uploding the developer commentary

Playtesting for the console version

*Playing hack requests and C3 content


EDIT: will stream again tomorrow, same time. We will finish the remaining parts of the ASM hack, do the wav tutorial and play viewer stuff. Playtesting for console will happen if the emulators are capable of being run at speed

Appologies for the delay! Starting now!
Originally posted by Final Theory
Does this ASM patch, is it just for SMW or any SNES game?

Being able to remap your buttons on the fly even on console is super useful because usually you can only do this in an emulator.


It will be a general purpose patch for any SMW hack. I decided to make it specifically because kaizo streamers have started talking about how certain hacks are too hard for controller players.
The controller remap patch is now available!


And has been added to the newest hackers dreams version. You will have to find it!

Originally posted by readme
controller remap by anonymousbl00dlust
supermaks helped

this patch will allow you to remap controls ingame using UberASM and a table.



how it works:

the patch works by adding a layer of indirection that looks up an entry into a table of freeram
for each byte in $15/$17, $16/$18, $0DAx/$0DAx+2, etc.
It ORAs the bytes together for each bit that is present in the ordinary mapping and then swaps that out
with the new version.

you need two tables of 20 bytes, one for each input bit. Two tables are needed because it double-buffers
the table and swaps them when you are done binding inputs. You need this so that your inputs done change
as you are binding them. if you only want a hardcoded remap, the second table is not necessary.

make sure that the main !mapping table is mapped to somewhere in ram that does not get cleared by
entering a level, etc, since this is what will be used to lookup inputs. note that storing zeros
will not give default controls but turn off controls alltogether. To set the default, see the helper
routines in the levelasm file.



how to use the patch:

apply the patch. Put the levelasm wherever you want to bind controls in your hack (inside of a sublevel etc).
Also make sure to call input_clear_mapping in UberASM at the start of your hack. Otherwise you you will not
be able to start the game since inputs will all be 0.

you should customize this so that the means of doing the binding fit whatever sort of setup (sublevel, etc)
you want within the context of your game. To this end there is the library functions which do the actual
work, plus a sample UberASM file which is just an example implementation of a level that binds controls.
It uses the first manual ExAnimation address to check which binding you are on. This means you should setup
ExAnimation to say things like "press up, press down, etc etc".


if you are a player trying to use this patch to play an existing game, swap out all references of !mapping
with hardcoded_map in the patch and don't bother with the UberASM. Permute the values in hardcoded_map
to get the bindings how you want them.


Please do not make a plug-and-play version of this because then everyone will just use it exactly the same way
without variation and creativity. I like that this takes a small amount of effort to set up because then
people will not make exactly the same things with it.


credits:

to use this patch I only request that you put my name in the status bar of the overworld and also
on the hud in every level. Plese make sure my name is ExAnimated bright flashing colors so that people
know how important my contribution to you hack was. Please also put
"asmmagician maks" name but in a smaller font.

I dont UNDErSTAND why standard players feel the need to pop off on kaizo after all these years of DOGPILING!

BOWSER IS NOT HURTING ANYONE AND IS ONLY PURSUING A CREATIVE OUTLET! WHAT DID HE EVERY DO TO YOU?!

cool hack tho! no drama


This thread is for a custom build of ZSNES which I released for hackers dreams. The basic premise is that the emulator uses shared memory so that the game's SRAM is visible to other processes on your computer. What that means is that you can create an .exe that reads that SRAM and does whatever you want to do with that information. This could include but is not limited to

1. Playing music files of arbitrarily high quality
2. Drawing graphics on top of the ZSNES window of arbitrarily high quality
3. etc etc etc


The purpose of this thread is to separately offer this small emulator modification as well as a general purpose music player that you can use for your own hacks. I will give a basic tutorial on how to set this up and how you can use the feature more generally.

Building addons for aZSNES

This assumes you know how to write a cpp program. Use the functions
OpenFileMapping and MapViewOfFile to access the shared memory. Once you have acces to the shared memory, infinite loop the program and respond to whatever addresses you need. You can use CopyMemory to grab the address you need to look at.

Code
	HANDLE hMapFile = NULL;
	LPCTSTR fast_sram = NULL;

	hMapFile = NULL;
	hMapFile = OpenFileMapping(
		FILE_MAP_ALL_ACCESS,		// read/write access
		FALSE,				// do not inherit the name
		"ZSNES");			// name of mapping object

	char sram_value = 0;
	if (hMapFile != NULL)
	{
		fast_sram = (LPTSTR)MapViewOfFile(hMapFile, // handle to map object
			FILE_MAP_ALL_ACCESS,  // read/write permission
			0x0000,
			0x0000,
			0);
		CopyMemory((PVOID)(((char*)fast_sram)+0x01C089), &sram_value, sizeof(TCHAR)); // example: using an address to play audio
	}

	while(true)
	{
		//do stuff based on address
		//read address again
	}


Using the prebuilt music player:

For the music player, all you have to do is write to $41C089*. The exe will lookup the value in this address and if it sees a change, play the a file named "#value_of_41C089.wav". It will not play on #$00. To mute just create an empty wav file and play that.

Here is a little routine that will play MSU-1 if the emulator/console supports that, else fallback on ZSNES and play the music through this application:

Code
PlayMusic: ; A = music file to play, with $00 being mute
	PHA
	LDA $002002
	CMP #$53
	BNE ++

	PLA
	CMP $2004
	BEQ +
	STA $2004
	stz $2005 ; track 0
	lda #$ff
	sta $2006 ; full volume
-
	bit $2000
	bvs -
	lda #$03
	sta $2007
	BRA +
	
	++
	PLA ;ZSNES audio
	BNE ++
	LDA #$08 ;I use 7 wav files and 8.wav as mute. you can use a different number if you want
	++
	STA $41C089
	+
	RTS


*this assumes you are using SA-1. if you are not using SA-1 use a different address and read that in your exe instead.

Preliminary FAQ:

ZSNES doesn't support SA-1

this version does because it is based on FuSoYa's zsnes build. it will save sram on SA-1.

ZSNES has input lag

see previous response. latency is superior to snes9x.

ZSNES can run arbitrary code due to a security bug


see previous response. Also, you are running exes to make this functionlity work, so its the same thing in a deliberate context. Difference is you are choosing to click the exe, same as you would any other program you download on the internet.

I don't want to use ZSNES because I have a preconceived notion in my head about the quality.

thats more of a comment.

Future Projects

It should be emphasized that you can do whatever arbitrary computations you want based on the SRAM data, so this is more than just a music player. The next thing I would like to try doing is drawing a transparent window ontop of ZSNES with opengl, and mirroring $146x in SRAM during an autoscroller or something in order to patch in a super-high resolution background. I'm curious what other ideas people can imagine doing with this and my hope is that people will play around and make more than just music players using this concept.

I'm not a particularly good programmer and this isn't really a huge programming feat. 99.999% of it is just built on top of existing code with a tiny change to make the SRAM viewable. I just think this is cool tech and would like to encourage other people to do it. Its really easy to get this working and it allows for things that would be impossible in any other context. Please enjoy :)

Download Link
Glad you all like it! Its been a lot of fun watching people play it!
  • Pages:
  • 1
  • 2
  • 35
  • 36
  • 37
  • 38