Author Topic: Dragon Warrior for PCE  (Read 2571 times)

Duo_R

  • Hero Member
  • *****
  • Posts: 3302
Re: Dragon Warrior for PCE
« Reply #15 on: May 16, 2016, 04:07:57 AM »
Interested in testing
Add my YouTube channel:


For sale trade list: http://tinyurl.com/2csm7kq

KingDrool

  • Hero Member
  • *****
  • Posts: 1990
Re: Dragon Warrior for PCE
« Reply #16 on: May 16, 2016, 04:15:45 AM »
Oh man, this is great news! Can't wait to see the finished product.
Games I Need: Bonk 3 (HuCard), Legend of Hero Tonma, Magical Chase, Soldier Blade, Super Air Zonk.

Got one to sell? PM me!

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Dragon Warrior for PCE
« Reply #17 on: May 16, 2016, 10:45:03 AM »
Excellent news, I look forward to seeing this!  :)

 I've been away for a while. Any news on the TED extended system card? How did that work out?


 On a coding note: For some strange reason I decided to do stack manipulation for the BRAM routines (they are written from scratch, instead of using the syscard ones). I'd normally use macros, but I decide to use JSRs instead, but needed an escape level that was above the original call.  So I just increment the stack, and hard jump to a return address on an upper level (for returning errors). Works quite nice. Not sure why I never did this before; saves more memory than macros and still keeps code listing nicely compact and clean.

 Not only that, but the logic for my loops is now different because of this setup. After years (a decade now) of coding in assembly, it's nice to see something different in logic/code approach. Doesn't mean so much to the user that can't see it, but it's kinda neat:

 
Code: [Select]
     ldx #$12
.LoopInner
      jsr __GetBRAMByte
      jsr __CMP_ID
      dex
    bne .LoopInner
      ;match found!
      ;return DIR offset in A:X, status in Y
      ;Y=0, OK
      cly
      lda __DIRoffset+1
      ldx __DIRoffset
    rts
__GetBRAMByte and __CMP_ID have their own error handling code, and fixes the stack to negate the call so it can hard jump to the error output routines. Or in the case of __CMP_ID, increment to the next DIR block, and re-enter the loop while __GetBRAMByte handles all out of bounds checks (both bram size and bram used range).

 Hmm. Maybe I could even go a step further with __GetBRAMByte, and have the return jump be from a table. And the index (into the jump table) would be the register in which the function that called it, would set the return address. That way I could reuse that code for other functions. I doubt that would be considered an "object" or some such, but something along those lines.. (reuseable code for a different function and slightly different code path). Or maybe not..

 Also, spring semester is over and two week coding frenzy has begun!
« Last Edit: May 16, 2016, 11:46:11 AM by Bonknuts »

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Dragon Warrior for PCE
« Reply #18 on: May 16, 2016, 11:59:53 AM »
I've been away for a while. Any news on the TED extended system card? How did that work out?

The System Card 3 patch that I posted a while back makes the whole of cartridge memory available as RAM, but it might be sensible to consider limiting yourself to 512KB unless you're really, really, really needing the extra space.

There's a header at the top of the "ROM" that can be detected, or you could just test for banks of RAM.

Here's the post ...

TED v2 Programming Notes
http://www.pcenginefx.com/forums/index.php?topic=20120.msg436169#msg436169

There's no new functionality included because I didn't want to break anything.

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Dragon Warrior for PCE
« Reply #19 on: May 16, 2016, 12:05:31 PM »
Quote
Hmm. Maybe I could even go a step further with __GetBRAMByte, and have the return jump be from a table. And the index (into the jump table) would be the register in which the function that called it, would set the return address.

I did something sort of like that once; fix stack pointer, then get the return address from a table and push it. Then when the function returned, it went back to the chosen function.
Was neat to try, just to see if it would work.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Dragon Warrior for PCE
« Reply #20 on: May 16, 2016, 12:05:49 PM »
Awesome :D 512k works out great. I'll probably stick with that (don't need it this second, but MM2 CD needs it).
« Last Edit: May 16, 2016, 01:50:10 PM by Bonknuts »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Dragon Warrior for PCE
« Reply #21 on: May 16, 2016, 01:48:31 PM »
Ok. BRAM functions all done. That took a bit longer than I expected. Heh. But at least I have a working hucard library set now.

BRAMUnlock
BRAMLock,
BRAMVerify (checks HUBM header)
BRAMFree (get free bytes)
BRAMInitialize (redundant check after initialize)
BRAMFindFile (get DIR entry: offset)
BRAMUpdateFile (update/overwrite DIR entry)
BRAMCreateFile (make a new DIR entry)

 It might be a bit overkill, but there are bound checks on all writes/reads. A lot of functions needed checksum compares, etc. I think I covered everything I could and have a decent level of error output.

 I didn't add a BRAMDeleteFile because I figured CD system can already handle that via the systemcard bios meny thingy. But now that I think about it, I have no idea how the BRAM booster units work. Do they come with a special card to interface with this? Or is there a built in card like the system bios that gives control over this? Weird that it never even crossed my mind.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Dragon Warrior for PCE
« Reply #22 on: May 16, 2016, 04:59:41 PM »
This should definitely be a CD image with orchestral soundtrack.   You can find the entire soundtrack remastered in like 2930023 forms online.. .


[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

ParanoiaDragon

  • Hero Member
  • *****
  • Posts: 4619
Re: Dragon Warrior for PCE
« Reply #23 on: May 16, 2016, 10:05:26 PM »
Tom, were you ever able to hack DW so that when you want to search or whatever, you didn't need to go to the menu?  I'm pretty sure we talked about that possibility, though, maybe I dreamed it?

poponon

  • Sr. Member
  • ****
  • Posts: 320
Re: Dragon Warrior for PCE
« Reply #24 on: May 17, 2016, 02:56:29 AM »
This should definitely be a CD image with orchestral soundtrack.   You can find the entire soundtrack remastered in like 2930023 forms online.. .

that'd be amazing

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Dragon Warrior for PCE
« Reply #25 on: May 17, 2016, 04:05:12 AM »
__GetBRAMByte and __CMP_ID have their own error handling code, and fixes the stack to negate the call so it can hard jump to the error output routines. Or in the case of __CMP_ID, increment to the next DIR block, and re-enter the loop while __GetBRAMByte handles all out of bounds checks (both bram size and bram used range).

That's quite neat ... you've basically implemented C++ "exception handling" in 6502!

It's the kind of thing that I recommend that you document, excessively, because you will forget what it's doing, and anyone looking at the code (if you release it) won't be expecting that kind of trick.

I usually see that kind of stack-manipulation used for inline-data on the 6502. That's where you jsr to a function, and the function pops the stack pointer, puts it in zero-page, and uses it a pointer to a table of data.

When it's finished reading the data, it just does an indirect jump through zero-page to return to the instruction after the data.

That's a nice way to pass a lot of variables into a function sometimes.

Vimtoman

  • Sr. Member
  • ****
  • Posts: 380
Re: Dragon Warrior for PCE
« Reply #26 on: May 17, 2016, 04:14:22 AM »
Here's a logo in PCE graphics that I've only begun to touch up and shade:





:)

(1) I would have the text overlap numeral "2" more aggressively!

(2) I'm on my phone and can't describe how it would be fun if... bottom layer = base trunk of "2", middle layer = logos, top layer = sections of "2" that "strategically  overlap edges of the logos (implying depth or  "weave" of 2 layers).

(3) Alternative (break horizontal line): Lower the NES down a few pixels + right, raise "NEC" a few pixels up + left.


/2ยข


With a bit of shadow to push the 2 back and lift the NEC PCE.

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Dragon Warrior for PCE
« Reply #27 on: May 17, 2016, 04:38:57 AM »
This should definitely be a CD image with orchestral soundtrack.   You can find the entire soundtrack remastered in like 2930023 forms online.. .

Yeah, great idea, that'd make it worth replaying.

Black Tiger

  • Hero Member
  • *****
  • Posts: 11242
Re: Dragon Warrior for PCE
« Reply #28 on: May 17, 2016, 06:52:01 AM »
The tracks that PD has done so far are pretty frealing cool.
http://www.superpcenginegrafx.net/forum

Active and drama free PC Engine forum

_joshuaTurbo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5156
Re: Dragon Warrior for PCE
« Reply #29 on: May 17, 2016, 09:56:40 AM »
Wooo!  really can't wait to play this again on an OBEY machine!

Thank you for all the hard work!!