Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / read a file with something like javas x-user-defined in agk???

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 2nd Aug 2016 15:22
Iam having huge problems as i nead to read a file that reads it with something like the java command x-user-defined??

Anyone having pointers to solve it in agk?

the file to read is in bytes ....

https://encoding.spec.whatwg.org/#ascii-byte
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Aug 2016 02:15
So x-user-defined is a JavaScript character type? (I googled as such a command isn't Java)

I'm unclear as to the exact problem since ago can read byte by byte. Is it the file structure you're having issues with or a type of encoding?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Aug 2016 10:21 Edited at: 4th Aug 2016 10:23
normal ascii is in this range 0 hex to 7F hex, so its return 1:1 else if it is bigger then you should return 0xF780 + byte − 0x80.

(Extended ASCII comprises 256 code points in the range 0 hex to FF hex = 0 to 255)

useful for you is at first CreateMemblockFromFile then interpret his bytes with GetMemblockByte

Quote: "15.5.1 x-user-defined decoder

x-user-defined's decoder's handler, given a stream and byte, runs these steps:

1. If byte is end-of-stream, return finished.

2. If byte is an ASCII byte, return a code point whose value is byte.

3. Return a code point whose value is 0xF780 + byte − 0x80.

15.5.2 x-user-defined encoder

x-user-defined's encoder's handler, given a stream and code point, runs these steps:

1. If code point is end-of-stream, return finished.

2. If code point is an ASCII code point, return a byte whose value is code point.

3. If code point is in the range U+F780 to U+F7FF, inclusive, return a byte whose value is code point − 0xF780 + 0x80.

4. Return error with code point. "


https://en.wikipedia.org/wiki/Code_point
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th Aug 2016 13:36
Thanks markus it where pretty simple when reading your comment
Iam going to check it later today

I tested both yesterday but throwed a bunch of errors to me ?

I could have written it wrong ???

phaelax..
It where a bit explaining a good way to read a byte file and use the encoding in agk
I have bin away from coding for a long while
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th Aug 2016 14:01
Hmmm must be something in the code anyway????

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th Aug 2016 14:33
Hmmmm
Wonder if they do this in java to read byte files because they dont have read byte or something ???

The command do simply keep read results around 0-256 right??
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th Aug 2016 19:14
Kudos for all pointers
Thanks markus for the tip about memory block

I found the stinking error and its fully working now

It where the stinking opcodes
One silly value in a opcode that where wrong
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th Aug 2016 15:57
Quote: "I found the stinking error and its fully working now

It where the stinking opcodes "


great
that means alls roms in your chip8 emu works now?
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th Aug 2016 16:04 Edited at: 5th Aug 2016 16:07
Yes they do
it where one silly value in one single place that made it all fail
Joy off coding

Iam currently cleaning it all up but as you have bin such an helping hand so could i upload it earlier if you want

I spent 1 whole day to correct another error i caused my self while cleaning it up
But its also fixed now

I also found why some games only displayed the intro screen.

In agk do i nead to add a extra key check inside a opcode that is infinit if there is no key press check there also .
Took a while to figure it out
python and java tutorials did not use that as they had some kind of listener plugin ?
It where pretty painfull to convert something like this from all various sources as i where forced to a bit of scrappboking coding with parts from many tutorials


So i have to say that its fully working now
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th Aug 2016 16:12
Iam working on adding hex input also for chip 8 demos and games.

They are easier to find as they are usually collected in simple text files.
something like this..

http://puu.sh/oAyWQ/8a6e25df5f.txt
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Aug 2016 07:43 Edited at: 6th Aug 2016 07:56
this opcode_FX0A with key wait looks special with this while wend.
maybe the programm counter did not step 2 until a key was pressed.

for this hex input i would add a textbox to file converter and then load it as normal rom.

btw, i wonder why u used val()
do

print(val("0xFFF",16))
print( 0xFFF)

print(val("0x00E0",16))
print(0x00E0)

sync()

loop
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th Aug 2016 14:37
In the java/python code so does it seam the key input listener is outside and regsters input even if the code is in a loop
Kevin picone already told me that the compiler reads hex as numbers
I thought i had to convert them to numbers with val in agk.
The bug where not there but i had to do a few hacks to get it to work n agk
off to party today so i might work again on the code tomorrow and release the latest?
I do not do to much programming lately
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th Aug 2016 14:42
I dont get to much feedback so i dont even know if the emulator is popular enought to continou to work on ??
I always wanted to do a emulator and is why i tryed to do a simple one before i try more advanced
Have my sights on msx / spectrum in agk
or even c64 in the end.
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 6th Aug 2016 16:27

Quote: " dont get to much feedback so i dont even know if the emulator is popular enought to continou to work on ??"


I'd never heard of it until seeing your post.. so i'd assume the majority of people here don't really understand what it is.


Quote: "I always wanted to do a emulator and is why i tryed to do a simple one before i try more advanced
Have my sights on msx / spectrum in agk
or even c64 in the end
"


unforunately c64's emulations need to be cycle accurate, as the software written for it tend make heavy use of raster interupts. Getting old stuff to work would be easier (some old emulation cache scan lines to make faster), but there mine field of timing problems when interleaving the cpu/graphics chips together.





PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Aug 2016 17:04
after your next chip8 release i will take a look
Quote: "or even c64 in the end"

myself started a c64 emu in blitzmax but i can't get it to work because some opcodes, i guess.
you can continue if you want.

AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th Aug 2016 20:52
yes sure markus
I could take a look
Post the blitz source here so will i try to check it later on

i think you are right kevin
Most tend to look at n64,ds and later machines then the early ones to emulate.
I never thought i could put together a chip8 emulation in agk
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th Aug 2016 09:34 Edited at: 8th Aug 2016 09:35
latest is up here

https://forum.thegamecreators.com/thread/217664#msg2587244
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Aug 2016 12:00
ok fine
AGK (Steam) V2.0.20 : Windows 10 Pro 64 Bit : AMD (16.3.2) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 05:00:18
Your offset time is: 2024-11-25 05:00:18