Stumped (entry level ASM, gah)

Página 2/6
1 | | 3 | 4 | 5 | 6

Por Grauw

Ascended (10564)

Imagen del Grauw

10-08-2014, 19:44

I believe with the Compass debugger (and the openMSX debugger as well) you can actually set breakpoints and step through your program to see where it goes wrong.

Por Driehoogvoor

Resident (52)

Imagen del Driehoogvoor

10-08-2014, 19:51

It's all working now. The reason why everything crashed is because CLS is really slow and I was calling it during the H.TIMI hook. So that probably flooded the stack, resulting in a big fat crash.

Anyways, the star field is working just fine for a first attempt. There's loads of stuff to improve, but I'll work on that tomorrow. When it's all finished, I'll post the source for feedback. Thanks for all the help, guys! Right now, it's time for SD Snatcher. LOL!

Por AxelF

Champion (395)

Imagen del AxelF

10-08-2014, 20:21

P.s.
@adress #F3E8 you can read out Spacebar, Joystick1 trigger A+B AND Joystick2 trigger A+B

F3E8 TRGFLG  Stores trigger button status of joystick
Information about trigger buttons and space bar state 
    7 6 5 4 3 2 1 0
    | | | |       +-- Space bar, trig(0) (0 = pressed)
    | | | +---------- Stick 1, Trigger 1 (0 = pressed)
    | | +------------ Stick 1, Trigger 2 (0 = pressed)
    | +-------------- Stick 2, Trigger 1 (0 = pressed)
    +---------------- Stick 2, Trigger 2 (0 = pressed)

Por Driehoogvoor

Resident (52)

Imagen del Driehoogvoor

11-08-2014, 18:10

Thanks, AxelF. I'll implement that this evening, after I finish up cleaning up my code. When that's done, I'll post the source and ask you guys for feedback. Smile

Por Driehoogvoor

Resident (52)

Imagen del Driehoogvoor

11-08-2014, 20:17

Well, I'm finally done. That took way longer than I thought, but I commented pretty much everything. And in the process forgot to update the space bar readout... But I'll start on that now, that doesn't seem like it's really hard.

So here it is—my parallax star field. Hope you guys can give me some feedback, and don't be afraid to hold back. Smile

File: stars.asm

Por Driehoogvoor

Resident (52)

Imagen del Driehoogvoor

11-08-2014, 20:40

Alright, that was ridiculously easy. I removed the NEWKEY EQU statement and in the SPACE loop, I replaced NEWKEY+8 with #F3E8. That was all that was needed, as the space bar is on bit 0 on both the keyboard matrix and the trigger flag address. :-)

Por Grauw

Ascended (10564)

Imagen del Grauw

12-08-2014, 00:18

Looks good!

Por MSX_Noob

Resident (51)

Imagen del MSX_Noob

13-08-2014, 10:43

Me again...instead of worrying about interrupts ,scroll sync and what not,
I should first try to get up before I start walking, right?... oO

So, I want to have a decent "environment" for editing and compiling ,which proves to be very cumbersome:

I'm using fMSX with a .dsk file that has wbass2 and asm and bin files,
and hardware type MSX-2 ; I use Disk-Manager to update, then I reset MSX to see and load the files.

(oh yes, it's on a Windows-7 64bit etc...)

So, I was trying to assemble the stars.asm in:

wbass2 (which I want to avoid, no offence WB!)-> when I load the asm file it it does not give error but the editor is empty (too large?)

pasmo (using --msx option) -> creates bin but when I "bload ,r" it in my emulator , it resets,
and this happens to all the pasmo compilings i tried.
when I use --bin option in pasmo msx throws a "bad file mode" for the bin file

sjasm -> I get errors on the labels but bin is created. however when I "bload" it ,MSX throws "bad file mode"

glass-msx (0.3 and 0.4) -> freaks out on the first line ,the "ORG #4000", guess it's picky on it's hex format?

tniasm -> sees #4000 as a label... no luck neither.

link to good discussion topic or some tips would be welcome. I don't want to give up because of ...that...

Por Driehoogvoor

Resident (52)

Imagen del Driehoogvoor

13-08-2014, 11:49

Hey MSX_Noob, I hope this will clear some stuff up: I wrote the code in Compass on a real F700D with a 1MB memory mapper cartridge in slot 1. So I think the code might indeed be too large for some emulated machines. I can make it load, assemble and run on an emulated F700D in OpenMSX with just its regular system roms (no extra memory mapper or anything), so you might want to try that.

Por Grauw

Ascended (10564)

Imagen del Grauw

13-08-2014, 14:02

Hey MSX_Noob,

For the emulator I would recommend openMSX. It has a great console and debugger, these are great developer tools and I use it a lot to inspect values, set smart watchpoints, test different machines, etc. The debugger can even step backwards in time!

It is also a very accurate emulator, so you are less likely to end up in a situation writing software that works on the emulator but not on a real machine. And you can point the emulated MSX drive to a directory and it will automatically make it accessible (for both read and write), so no need for a disk manager.

As for Glass, I added support for # notation in version 0.4 so that isn’t the problem. It aborts with:

Exception in thread "main" nl.grauw.glass.LineParser$SyntaxError: Syntax error.
[at /Users/grauw/Downloads/stars.asm:220,0] 
                                            ^

This means at character 0 of line 220 of stars.asm, it has found something strange.

The reason it freaks out is because somehow in your source code you managed to put an invisible “SUB” (26 / 1AH) character on lines 220 and 296. This is not a valid character for a label so Glass aborts with a syntax error, this probably also trips up the other assemblers with those label errors. If you go to these lines and press backspace you’ll notice that the cursor won’t move, but it will delete the character.

After that, if you try to assemble again it will complain that on lines 43 and 89 you used a nonexistant Z80 instruction; CP A,0 should be CP 0, and SUB A,B should be SUB B. Glass only accepts the official Zilog notation. When you fix those two, it will compile.

Página 2/6
1 | | 3 | 4 | 5 | 6