diff --git a/OutlawEditor/README.md b/OutlawEditor/README.md index efebd8ba..42b540a6 100644 --- a/OutlawEditor/README.md +++ b/OutlawEditor/README.md @@ -5,7 +5,7 @@ This is a multi-platform RPG game editor. It is written in (and requires) Java Download -------- -The most recent copy of Outlaw Editor (aka the Daily build) can be found here: http://8bitweapon.com/lawlesslegends/OutlawEditor/target/jfx/app/OutlawEditor-jfx.jar +The most recent copy of Outlaw Editor (aka the Daily build) can be found here: https://www.dropbox.com/s/2bhoxqrqjjehmqb/OutlawEditor-jfx.jar Running the program ------------------- diff --git a/Platform/Apple/virtual/src/tile/tile.s b/Platform/Apple/virtual/src/tile/tile.s index 5542562e..9ad5d8ee 100644 --- a/Platform/Apple/virtual/src/tile/tile.s +++ b/Platform/Apple/virtual/src/tile/tile.s @@ -55,9 +55,12 @@ DRAW_X_START = $5E ; Starting column being drawn (between 0 and VIEWPORT_WIDTH) DRAW_Y_START = $5F ; Starting row being drawn (between 0 and VIEWPORT_WIDTH) SECTION_X_START = $60 ; X Offset relative to current section being drawn SECTION_Y_START = $61 ; Y Offset relative to current section being drawn -DRAW_WIDTH = $62 ; Number of columns to draw for current section -DRAW_HEIGTH = $63 ; Number of rows to draw for current section +DRAW_WIDTH = $62 ; Number of columns to draw for current section (cannot be destroyed by drawing loop) +DRAW_HEIGTH = $63 ; Number of rows to draw for current section (cannot be destroyed by drawing loop) DRAW_SECTION = $64 ; Location of section data being drawn +X_COUNTER = $66 ; Loop counter used during drawing +Y_COUNTER = $67 ; Loop counter used during drawing +ROW_LOCATION = $68 ; Used for pointing at row offset in map data ; >> INIT (reset map drawing vars) INIT @@ -326,7 +329,7 @@ CROSS_WEST SBC SECTION_Y_START STA DRAW_HEIGHT !move_word ptr, DRAW_SECTION - jsr mainDraw + jsr mainDraw } DRAW @@ -390,20 +393,144 @@ DRAW ; ; The calculation goes like this: Page + $78 + (Row * $100) + (Col & 7) + ((Col & 8) << 4) ; When the display is drawn, the screen hole is compared to see if there is a different tile to draw -; and if there isn't then the tile is skipped. Otherwise the tile is drawn, etc. +; and if there is not then the tile is skipped. Otherwise the tile is drawn, etc. ;-------------------------------------- +COL_OFFSET = 2 +ROW_OFFSET = 3 + ; Identify start of map data (upper left) + ; Self-modifying code: Update all the STA statements in the drawTile section + LDY DRAW_Y_START + LDA tblHGRl+ROW_OFFSET, Y + ADC #COL_OFFSET + TAX + INX + !for store, 16 { + STA .drawTile+(store*14)+3 + STX .drawTile+(store*14)+10 + !if store=16 { + LDA tblHGRl+ROW_OFFSET+1, Y + } + } + LDA tblHGRh+ROW_OFFSET, Y + !for store, 16 { + STA .drawTile+(store*14)+4 + STA .drawTile+(store*14)+11 + !if store = 7 { + LDA tblHGRh+ROW_OFFSET+1, Y + } else { + ; We have to calculate the start of the next row but only if we are not already at the last row + !if store < 15 { + adc #$04 + } + } + } + +;Calculate data offset == DRAW_SECTION + (row * 22) + 6 == DRAW_SECTION + (row * 2 + row * 4 + row * 16) + 6 + CLC + LDA SECTION_Y_START ;row * 2 + ASL + ADC #HEADER_LENGTH + ADC SECTION_X_START + STA ROW_LOCATION + LDA SECTION_Y_START ; row * 4 + ASL + ASL + ADC ROW_LOCATION + STA ROW_LOCATION + LDA SECTION_Y_START ; row * 16 -- possibly carry + ASL + ASL + ASL + ASL + ADC ROW_LOCATION + STA ROW_LOCATION + LDA DRAW_SECTION + 1 + ADC #$00 ; This is a short way for handling carry without a branch + STA ROW_LOCATION + 1 + LDA DRAW_SECTION + ADC ROW_LOCATION + STA ROW_LOCATION + ; Handle carry if needed + BCC .doneCalculatingLocation + INC ROW_LOCATION + 1 +.doneCalculatingLocation + CLC + LDA SECTION_Y_START + ASL + ADC ROW_LOCATION + STA ROW_LOCATION + LDA SECTION_Y_START + ASL + ASL + ADC ROW_LOCATION + STA ROW_LOCATION + + LDX DRAW_X_START ; Display row of tiles +.next_col ; Get tile + LDA ROW_LOCATION, X + ; Calculate location of tile data == tile_base + ((tile & 31) * 16) + AND #31 + ASL + ASL + ASL + ASL + STA TILE_SOURCE + LDA TILE_BASE + ADC #$00 + STA TILE_SOURCE+1 + LDA TILE_BASE + ADC TILE_SOURCE + STA TILE_SOURCE + BCC .doenCalculatingTileLocation + INC TILE_SOURCE+1 +.doenCalculatingTileLocation ; Is there a NPC there? ; No, use map tile ; Yes, use NPC tile ; Compare tile to last-drawn tile ; Skip if no change -; Is this the first time we're drawing this row? +; Is this the first time we are drawing this row? ; -- It is, update the draw pointers ; If tile is different then redraw ; -- unrolled loop for 16 rows at a time + LDY #$00 + TXA ; In the drawing part, we need X=X*2 + ASL + TAX +.drawTile !for row, 16 { +.0 LDA (TILE_SOURCE),Y +.2 STA DRAW_ROW, X +.5 INY +.6 INX +.7 LDA (TILE_SOURCE),Y +.9 STA DRAW_ROW, X + !if row < 15 { +.12 INY +.13 DEX + } + } + } + DEC X_COUNTER + BMI .next_row + TXA ; Outside the drawing part we need to put X back (divide by 2) + LSR + TAX + BNE .next_col ; Increment row -; Draw player \ No newline at end of file +.next_row + +; Draw player + +tblHGRl + !byte $00,$80,$00,$80,$00,$80,$00,$80 + !byte $28,$A8,$28,$A8,$28,$A8,$28,$A8 + !byte $50,$D0,$50,$D0,$50,$D0,$50,$D0 + +tblHGRh + !byte $00,$00,$01,$01,$02,$02,$03,$03 + !byte $00,$00,$01,$01,$02,$02,$03,$03 + !byte $00,$00,$01,$01,$02,$02,$03,$03 \ No newline at end of file diff --git a/README.md b/README.md index 5a2bb802..8b7d571d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,10 @@ Download Links -------------- - The most recent copy of Outlaw Editor (aka the Daily build) can be found here: https://www.dropbox.com/s/2bhoxqrqjjehmqb/OutlawEditor-jfx.jar -- Live builds of the Apple platform code (AKA the Apple // series game port) will soon be available +- Live builds of the Apple platform code (AKA the Apple // series game port) will soon be available +- Download the 2014 KFest playable demo disk here: https://www.dropbox.com/s/j7pwpgweu65i4md/Lawless%20Legends%20-%20KFest%20playable%20demo%20-%20v0_50.dsk + +If you are curious how the Ray Caster works, Martin Haye has made a tutorial with versions in both text and video: https://github.com/badvision/lawless-legends/blob/master/Docs/Tutorials/BigBlue/TaleOfBigBlue.md How to get involved ------------------- @@ -18,9 +21,10 @@ Grab a daily build and play with it! If you are a QA tester or a developer you You (yes, you!) can get involved even if you have no programming experience and just want to dabble with retro gaming. We will need testers who are not afraid to press untold combinations of buttons for the sake of breaking things and telling the programmers how misbehaved our code is. You are welcome to test our build process for yourself and let us know if there's a way you think we can make it easier -- because ultimately we are striving to collaborate with modern technology while building a game that runs on old pre-internet 8-bit technology: There are bound to be pitfalls and some amount of inconvenience is almost assured! But despite this, we think we can achieve the following: -- Common game creation tools (Outlaw Editor) which run in all modern OS platforms using Java 7 / JavaFX 2.2 (Java 8 compatibility will be assured after Java 8 GA is released) -- Native game development on-platform, meaning you code the Apple engine on the Apple (via Merlin Pro) +- Common game creation tools (Outlaw Editor) which run in all modern OS platforms using Java 8 / JavaFX +- Native game development on-platform, meaning you code the Apple engine on the Apple (via the ACME assembler) - Native program code is managed within the virtual computer's disk image and synchronized out via provided scripts (see Notes to 6502 Coders below) +- Much game logic is/will be written in PLASMA, a moderately high level language that runs on the Apple II. - Native game development and game previewing is possible on real hardware (using VSDrive/ADT Pro or CDDB), or emulation (using _any_ apple //e or //gs emulator) - New tricks to teach our old dogs. Many surprises await! @@ -30,9 +34,11 @@ Notes to 6502 Coders Time to ROL up your sleeves and accumulate some good documentation on Prodos memory layouts and Prodos device drivers! We're going to make this game so that you can run (and exit back to) Prodos on any 128kb (or more) machine. That means the //c and //gs will be natively compatible as well. We have some cool routines written, but are still in our infancy: - Fast tile drawing using text page 1 ($400-$7ff) as scratchpad - Crazy awesome Hi-res 3D raycaster engine +- Module-based memory management which can utilize extra ram whenever possible +- PLASMA interpreter We need a lot more, and ideas are greatly appreciated for the following: -- Module-based memory management which can utilize extra ram whenever possible +- 2D tile drawing engine - Mockingboard playback routines - Ensoniq DOC playback routines - Image depack routines, with support for animation frames and transparent overlays.